WebRequest.GetRequestStreamAsync 方法

定义

当在子类中被重写时,将用于写入数据的 Stream 作为异步操作返回到 Internet 资源。

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)

返回

表示异步操作的任务对象。

注解

此操作不会阻止。 当将数据写入 Internet 资源的 可用时Stream,返回Task<TResult>的对象将完成。

调用 GetRequestStreamAsync后,请确保在调用 GetResponseAsync之前关闭请求流。

适用于