This documentation is archived and is not being maintained.

Using an AsyncCallback Delegate to End an Asynchronous Operation

Applications that can do other work while waiting for the results of an asynchronous operation should not block waiting until the operation completes. Use one of the following options to continue executing instructions while waiting for an asynchronous operation to complete:

The following code example demonstrates using asynchronous methods in the Dns class to retrieve Domain Name System (DNS) information for user-specified computers. This example creates an AsyncCallback delegate that references the ProcessDnsInformation method. This method is called once for each asynchronous request for DNS information.

Note that the user-specified host is passed to the BeginGetHostByName Object parameter. For an example that demonstrates defining and using a more complex state object, see Using an AsyncCallback Delegate and State Object.

No code example is currently available or this language may not be supported.
Show: