WebRequest.GetRequestStreamAsync 方法

定義

在子代類別中覆寫時,傳回以非同步作業方式將資料寫入網際網路資源的 StreamWhen overridden in a descendant class, returns a Stream for writing data to the Internet resource as an asynchronous operation.

public:
 virtual System::Threading::Tasks::Task<System::IO::Stream ^> ^ GetRequestStreamAsync();
public virtual System.Threading.Tasks.Task<System.IO.Stream> GetRequestStreamAsync ();
abstract member GetRequestStreamAsync : unit -> System.Threading.Tasks.Task<System.IO.Stream>
override this.GetRequestStreamAsync : unit -> System.Threading.Tasks.Task<System.IO.Stream>
Public Overridable Function GetRequestStreamAsync () As Task(Of Stream)

傳回

Task<Stream>

工作物件,表示非同步作業。The task object representing the asynchronous operation.

備註

這項作業不會封鎖。This operation will not block. Task<TResult>當可用來將 Stream 資料寫入網際網路資源時,傳回的物件將會完成。The returned Task<TResult> object will complete when the Stream for writing data to the Internet resource is available.

在呼叫之後 GetRequestStreamAsync ,請務必先關閉要求資料流程,然後再呼叫 GetResponseAsyncAfter you call GetRequestStreamAsync, make sure you close the request stream before you call GetResponseAsync.

適用於