HttpRequest.InsertEntityBody HttpRequest.InsertEntityBody HttpRequest.InsertEntityBody HttpRequest.InsertEntityBody Method

定義

提供 IIS 方法的 Managed 包裝函式,這個方法會將 HTTP 要求實體本文插入記憶體中。Provides a managed wrapper for the IIS method that inserts an HTTP request entity body into memory.

多載

InsertEntityBody() InsertEntityBody() InsertEntityBody() InsertEntityBody()

將 HTTP 要求實體本文的複本提供給 IIS。Provides IIS with a copy of the HTTP request entity body.

InsertEntityBody(Byte[], Int32, Int32) InsertEntityBody(Byte[], Int32, Int32) InsertEntityBody(Byte[], Int32, Int32) InsertEntityBody(Byte[], Int32, Int32)

將 HTTP 要求實體本文的複本及該要求實體物件的相關資訊提供給 IIS。Provides IIS with a copy of the HTTP request entity body and with information about the request entity object.

備註

InsertEntityBody方法多載會提供受管理的存取權給 IIS 7IHttpRequest::InsertEntityBody方法。The InsertEntityBody method overloads provide managed access to the IIS 7 IHttpRequest::InsertEntityBody method. IIS 方法會插入記憶體中的 HTTP 要求實體主體 (用戶端所張貼的資料)。The IIS method inserts an HTTP request entity body (the data that is posted by a client) into memory. 這是實體的很有用,因為 IIS 不會維護一份要求之後已讀取。This is useful because IIS does not maintain a copy of the request entity after it has been read. InsertEntityBody方法建立的 HTTP 要求實體資料複本,並將它提供給 IIS 的其他自訂處理。The InsertEntityBody methods create a copy of the HTTP request entity data and make it available to IIS for additional custom handling.

注意

InsertEntityBody方法多載工作只在 IIS 7.0 或更新版本,因為IHttpRequest::InsertEntityBody方法在 IIS 7.0 中所加入。The InsertEntityBody method overloads work only on IIS 7.0 or later, because the IHttpRequest::InsertEntityBody method was added in IIS 7.0.

InsertEntityBody() InsertEntityBody() InsertEntityBody() InsertEntityBody()

將 HTTP 要求實體本文的複本提供給 IIS。Provides IIS with a copy of the HTTP request entity body.

public:
 void InsertEntityBody();
public void InsertEntityBody ();
member this.InsertEntityBody : unit -> unit
Public Sub InsertEntityBody ()

例外狀況

已在比 IIS 7.0 版舊的 IIS 上叫用此方法。The method was invoked on a version of IIS earlier than IIS 7.0.

備註

已讀取之後,IIS 就不會維護要求的複本。IIS does not maintain a copy of the request after it has been read. 因此,建議只針對 HTTP 要求處理常式應該讀取要求的實體。Therefore, it is recommended that only the handler for an HTTP request should read the request entity.

HttpRequest.InsertEntityBody方法多載以一份要求的實體提供 IIS 先前讀取 asp.net。The HttpRequest.InsertEntityBody method overload provides IIS with a copy of the request entity if it was previously read by ASP.NET. 這個方法多載可用於 ASP.NET 具有讀取實體的要求,而且您想要重複使用現有的要求資料。This method overload is useful for cases where ASP.NET has read the entity request and you want to reuse the existing request data.

安全性

AspNetHostingPermission
在主控環境中運作。For operating in a hosted environment. 安全性動作: DemandSecurity action: Demand. 相關聯的列舉型別: HighAssociated enumeration: High

InsertEntityBody(Byte[], Int32, Int32) InsertEntityBody(Byte[], Int32, Int32) InsertEntityBody(Byte[], Int32, Int32) InsertEntityBody(Byte[], Int32, Int32)

將 HTTP 要求實體本文的複本及該要求實體物件的相關資訊提供給 IIS。Provides IIS with a copy of the HTTP request entity body and with information about the request entity object.

public:
 void InsertEntityBody(cli::array <System::Byte> ^ buffer, int offset, int count);
public void InsertEntityBody (byte[] buffer, int offset, int count);
member this.InsertEntityBody : byte[] * int * int -> unit
Public Sub InsertEntityBody (buffer As Byte(), offset As Integer, count As Integer)

參數

buffer
Byte[]

包含要求實體資料的陣列。An array that contains the request entity data.

offset
Int32 Int32 Int32 Int32

buffer 中要開始儲存該要求實體資料的位置 (以零起始)。The zero-based position in buffer at which to begin storing the request entity data.

count
Int32 Int32 Int32 Int32

要讀入 buffer 陣列的位元組數目。The number of bytes to read into the buffer array.

例外狀況

已在比 IIS 7.0 版舊的 IIS 上叫用此方法。The method was invoked on a version of IIS earlier than IIS 7.0.

在指定 count 值的情況下,buffer 中的項目數大於 offset 的可用空間。The number of items in count is larger than the available space in buffer, given the offset value.

備註

已讀取之後,IIS 就不會維護要求的複本。IIS does not maintain a copy of the request after it has been read. 因此,建議只針對 HTTP 要求處理常式應該讀取要求的實體。Therefore, it is recommended that only the handler for an HTTP request should read the request entity.

HttpRequest.InsertEntityBody方法多載是很有用,當您想要執行自訂處理,例如不同的實體本文插入記憶體。The HttpRequest.InsertEntityBody method overload is useful when you want to perform custom processing, such as inserting a different entity body into memory.

安全性

AspNetHostingPermission
用於裝載環境中的作業。for operating in a hosted environment. 安全性動作: DemandSecurity action: Demand. 相關聯的列舉型別: HighAssociated enumeration: High

適用於