SocketAsyncEventArgs.UserToken SocketAsyncEventArgs.UserToken SocketAsyncEventArgs.UserToken SocketAsyncEventArgs.UserToken Property

定义

获取或设置与此异步套接字操作关联的用户或应用程序对象。Gets or sets a user or application object associated with this asynchronous socket operation.

public:
 property System::Object ^ UserToken { System::Object ^ get(); void set(System::Object ^ value); };
public object UserToken { get; set; }
member this.UserToken : obj with get, set
Public Property UserToken As Object

属性值

一个对象,表示与此异步套接字操作关联的用户或应用程序对象。An object that represents the user or application object associated with this asynchronous socket operation.

注解

应用程序可以使用此属性将应用程序状态对象与SocketAsyncEventArgs对象相关联。This property can be used by an application to associate an application state object with the SocketAsyncEventArgs object. 此属性主要用于向应用程序传递状态和应用程序的事件处理程序 (例如异步操作完成方法)。Primarily, this property is a way for an application to pass state to the application's event handler (for example, the asynchronous operation completion method).

此属性用于所有异步套接字 (xxxAsync) 方法。This property is used with all of the asynchronous socket (xxxAsync) methods.

适用于

另请参阅