PeekCompletedEventArgs.AsyncResult 屬性


取得或設定要求的非同步作業結果。Gets or sets the result of the asynchronous operation requested.

 property IAsyncResult ^ AsyncResult { IAsyncResult ^ get(); void set(IAsyncResult ^ value); };
public IAsyncResult AsyncResult { get; set; }
member this.AsyncResult : IAsyncResult with get, set
Public Property AsyncResult As IAsyncResult


IAsyncResult,包含與窺視作業相關聯的資料。A IAsyncResult that contains the data associated with the peek operation.


AsyncResult識別進行中或已完成的非同步作業。AsyncResult identifies ongoing or completed asynchronous operations. 屬性包含的資料可協助您判斷要完成數個可能的非同步作業, 並在傳遞至事件處理常式EndPeek時, 能夠存取與已完成之作業相關聯的訊息。The property contains data that helps determine which of several potential asynchronous operations to complete, and when passed to the event handler, enables EndPeek to access the message associated with the completed operation.

當您呼叫BeginPeek IAsyncResult時, 會立即傳回, 即使有訊息 (如果有的話) 尚未被取得, 因為作業並未完成。When you call BeginPeek, a IAsyncResult is returned immediately, even though a message, if one exists, has not yet been retrieved because the operation is not completed. AsyncResult表示非同步作業的狀態。The AsyncResult indicates the state of the asynchronous operation. BeginPeek建立物件, 它會在整個作業中修改, EndPeek直到完成為止。BeginPeek creates the object, which is modified throughout the operation until EndPeek completes it.