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


获取一个 Stream 对象,该对象可用于读取传入的 HTTP 实体主体。Gets a Stream object that can be used to read the incoming HTTP entity body.

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


一个 Stream 对象,该对象可用于读取传入的 HTTP 实体主体。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 使用的内部存储的字节Form,以填充、 FilesInputStream属性。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 窗体页面(.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.