HttpRequest.GetBufferedInputStream HttpRequest.GetBufferedInputStream HttpRequest.GetBufferedInputStream HttpRequest.GetBufferedInputStream Method

定義

取得可用來讀取連入 HTTP 實體本文的 Stream 物件。Gets a Stream object that can be used to read the incoming HTTP entity body.

public:
 System::IO::Stream ^ GetBufferedInputStream();
public System.IO.Stream GetBufferedInputStream ();
member this.GetBufferedInputStream : unit -> System.IO.Stream
Public Function GetBufferedInputStream () As Stream

傳回

可用來讀取連入 HTTP 實體本文的 Stream 物件。A Stream object that can be used to read the incoming HTTP entity body.

例外狀況

已載入並剖析要求的實體主體。The request's entity body has already been loaded and parsed. 造成載入及剖析實體主體的屬性包含下列範例:Examples of properties that cause the entity body to be loaded and parsed include the following: - Form 屬性。- The Form property.

- Files 屬性。- The Files property.

- InputStream 屬性。- The InputStream property.

- GetBufferlessInputStream() 方法。- The GetBufferlessInputStream() method.

若要避免此例外狀況,首先呼叫ReadEntityBodyMode方法。To avoid this exception, call the ReadEntityBodyMode method first. 如果在讀取實體主題時中斷連接用戶端,也會擲回這個例外狀況。This exception is also thrown if the client disconnects while the entity body is being read.

備註

這個方法相當於GetBufferlessInputStream不同之處在於它也會將讀取的位元組複製到內部儲存體,供 ASP.NET 用來填入FormFiles,和InputStream屬性。This method is identical to GetBufferlessInputStream except that it also copies the bytes that are read to the internal storage that is used by ASP.NET to populate the Form, Files, and InputStream properties. 由於保留了這項資訊,如 ASP.NET Web Form 網頁 (.aspx 檔) 等下游程式碼將會成功執行。Because this information is preserved, downstream code such as ASP.NET Web Forms pages (.aspx files) will run successfully. 這不是使用 GetBufferlessInputStream 方法的情況。This is not the case with the GetBufferlessInputStream method.

適用於