AsyncResult.AsyncState Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets the object provided as the last parameter of a BeginInvoke method call.

Namespace:   System.Runtime.Remoting.Messaging
Assembly:  mscorlib (in mscorlib.dll)

abstract AsyncState : Object with get
override AsyncState : Object with get

Property Value

Type: System.Object

The object provided as the last parameter of a BeginInvoke method call.

For more information about the BeginInvoke method, see Asynchronous Programming Using Delegates.

The following code example demonstrates how the AsyncState property is used to pass information to a callback method. The last parameter of the BeginInvoke method call is a format string, which the callback method uses to format an output message.

The example consists of two classes, the class that contains the method which is called asynchronously, and the class that contains the Main method that makes the call.

For more information on the way this callback example works, and more examples of calling methods asynchronously by using delegates, see Calling Synchronous Methods Asynchronously.

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

.NET Framework
Available since 1.1
Return to top
Show: