HttpRequestWrapper 類別

定義

封裝 HTTP 內建物件,此物件可讓 ASP.NET 讀取用戶端在 Web 要求期間傳送的 HTTP 值。Encapsulates the HTTP intrinsic object that enables ASP.NET to read the HTTP values that are sent by a client during a Web request.

public ref class HttpRequestWrapper : System::Web::HttpRequestBase
public class HttpRequestWrapper : System.Web.HttpRequestBase
type HttpRequestWrapper = class
    inherit HttpRequestBase
Public Class HttpRequestWrapper
Inherits HttpRequestBase
繼承
HttpRequestWrapper

備註

HttpRequestWrapper類別衍生自 HttpRequestBase 類別,並作為類別的包裝函式 HttpRequestThe HttpRequestWrapper class derives from the HttpRequestBase class and serves as a wrapper for the HttpRequest class. 這個類別會公開類別的功能 HttpRequest 並公開型別 HttpRequestBaseThis class exposes the functionality of the HttpRequest class and exposes the HttpRequestBase type. HttpRequestBase類別可讓您 HttpRequest 在應用程式中使用自訂的實作為來取代類別的原始實作為,例如,當您在 ASP.NET 管線外部執行單元測試時。The HttpRequestBase class enables you to replace the original implementation of the HttpRequest class in your application with a custom implementation, such as when you perform unit testing outside the ASP.NET pipeline.

建構函式

HttpRequestWrapper(HttpRequest)

使用指定的要求物件來初始化 HttpRequestWrapper 類別的新執行個體。Initializes a new instance of the HttpRequestWrapper class by using the specified request object.

屬性

AcceptTypes

取得用戶端支援的 MIME 接受 (Accept) 類型的陣列。Gets an array of client-supported MIME accept types.

AnonymousID

取得使用者的匿名識別項 (如果有的話)。Gets the anonymous identifier for the user, if it is available.

ApplicationPath

取得伺服器上 ASP.NET 應用程式的根虛擬路徑。Gets the virtual path of the root of the ASP.NET application on the server.

AppRelativeCurrentExecutionFilePath

取得應用程式根目錄的虛擬路徑,並對應用程式根目錄使用波狀符號 (~) 標記法,讓此路徑變成相對路徑 (就像是 "~/page.aspx")。Gets the virtual path of the application root and makes it relative by using the tilde (~) notation for the application root (as in "~/page.aspx").

Browser

取得要求用戶端之瀏覽器功能的相關資訊。Gets information about the requesting client's browser capabilities.

ClientCertificate

取得目前要求的用戶端安全憑證。Gets the current request's client security certificate.

ContentEncoding

取得或設定用戶端所提供資料的字元集。Gets or sets the character set of the data that was provided by the client.

ContentLength

取得用戶端送出的內容長度,以位元組為單位。Gets the length, in bytes, of content that was sent by the client.

ContentType

取得或設定要求的 MIME 內容類型。Gets or sets the MIME content type of the request.

Cookies

取得用戶端傳送的 Cookie 集合。Gets the collection of cookies that were sent by the client.

CurrentExecutionFilePath

取得目前要求的虛擬路徑。Gets the virtual path of the current request.

CurrentExecutionFilePathExtension

取得 CurrentExecutionFilePath 屬性中指定之檔案名稱的副檔名。Gets the extension of the file name that is specified in the CurrentExecutionFilePath property.

CurrentExecutionFilePathExtension

在衍生類別中實作時,取得 CurrentExecutionFilePath 屬性所指定之檔案名稱的副檔名。When implemented in a derived class, gets the extension of the file name that is specified in the CurrentExecutionFilePath property.

(繼承來源 HttpRequestBase)
FilePath

取得目前要求的虛擬路徑。Gets the virtual path of the current request.

Files

取得用戶端上傳的檔案集合,其格式為多重 MIME。Gets the collection of files that were uploaded by the client, in multipart MIME format.

Filter

取得或設定讀取目前輸入資料流時使用的篩選條件。Gets or sets the filter to use when the current input stream is being read.

Form

取得用戶端傳送的表單變數集合。Gets the collection of form variables that were sent by the client.

Headers

取得用戶端傳送的 HTTP 標頭集合。Gets the collection of HTTP headers that were sent by the client.

HttpChannelBinding

取得目前 ChannelBinding 執行個體的 HttpWorkerRequest 物件。Gets the ChannelBinding object of the current HttpWorkerRequest instance.

HttpChannelBinding

在衍生類別中覆寫時,取得目前 ChannelBinding 執行個體的 HttpWorkerRequest 物件。When overridden in a derived class, gets the ChannelBinding object of the current HttpWorkerRequest instance.

(繼承來源 HttpRequestBase)
HttpMethod

取得用戶端使用的 HTTP 資料傳輸方法 (例如 GETPOSTHEAD)。Gets the HTTP data-transfer method (such as GET, POST, or HEAD) that was used by the client.

InputStream

取得連入 HTTP 實體主體的內容。Gets the contents of the incoming HTTP entity body.

IsAuthenticated

取得值,這個值表示要求是否已經驗證。Gets a value that indicates whether the request has been authenticated.

IsLocal

取得值,表示要求是否來自於本機電腦。Gets a value that indicates whether the request is from the local computer.

IsSecureConnection

取得值,這個值表示 HTTP 連接是否使用安全通訊端 (HTTPS 通訊協定)。Gets a value that indicates whether the HTTP connection uses secure sockets (HTTPS protocol).

Item[String]

CookiesFormQueryStringServerVariables 集合取得指定的物件。Gets the specified object from the Cookies, Form, QueryString, or ServerVariables collections.

LogonUserIdentity

取得目前使用者的 WindowsIdentity 類型。Gets the WindowsIdentity type for the current user.

Params

取得 QueryStringFormServerVariablesCookies 項目的組合集合。Gets a combined collection of QueryString, Form, ServerVariables, and Cookies items.

Path

取得目前要求的虛擬路徑。Gets the virtual path of the current request.

PathInfo

取得具有 URL 副檔名之資源的額外路徑資訊。Gets additional path information for a resource that has a URL extension.

PhysicalApplicationPath

取得目前應用程式之根目錄的實體檔案系統路徑。Gets the physical file-system path of the current application's root directory.

PhysicalPath

取得要求之資源的實體檔案系統路徑。Gets the physical file-system path of the requested resource.

QueryString

取得 HTTP 查詢字串變數的集合。Gets the collection of HTTP query-string variables.

RawUrl

取得目前要求的完整 URL。Gets the complete URL of the current request.

ReadEntityBodyMode

取得值,指出是否已讀取要求實體主體,而且如果是,如何讀取。Gets a value that indicates whether the request entity body has been read, and if so, how it was read.

ReadEntityBodyMode

在衍生類別中實作時,取得值,這個值表示是否已讀取要求實體內容及其讀取方式 (如果已讀取的話)。When implemented in a derived class, gets a value that indicates whether the request entity body has been read, and if so, how it was read.

(繼承來源 HttpRequestBase)
RequestContext

取得目前要求的 RequestContext 執行個體。Gets the RequestContext instance of the current request.

RequestContext

在衍生類別中覆寫時,取得目前要求的 RequestContext 執行個體。When overridden in a derived class, gets the RequestContext instance of the current request.

(繼承來源 HttpRequestBase)
RequestType

取得或設定用戶端使用的 HTTP 資料傳輸方法 (GETPOST)。Gets or sets the HTTP data-transfer method (GET or POST) that was used by the client.

ServerVariables

取得 Web 伺服器變數的集合。Gets a collection of Web server variables.

TimedOutToken

取得要求逾時所觸發的 CancellationToken 物件。Gets a CancellationToken object that is tripped when a request times out.

TimedOutToken

在衍生類別中實作時,取得要求逾時所觸發的 CancellationToken 物件。When implemented in a derived class, gets a CancellationToken object that is tripped when a request times out.

(繼承來源 HttpRequestBase)
TlsTokenBindingInfo

取得 TLS 權杖繫結資訊。Gets the Tls token binding information.

TlsTokenBindingInfo

取得或設定此執行個體的權杖繫結資訊。Gets or sets the token binding information for this instance.

(繼承來源 HttpRequestBase)
TotalBytes

取得目前輸入資料流的位元組數目。Gets the number of bytes in the current input stream.

Unvalidated

提供 HTTP 要求值的存取,而不觸發要求驗證。Gets an access to HTTP request values without triggering request validation.

Unvalidated

在衍生類別中實作時,提供對 HTTP 要求值的存取,而不觸發要求驗證。When implemented in a derived class, provides access to HTTP request values without triggering request validation.

(繼承來源 HttpRequestBase)
Url

取得關於目前要求的 URL 資訊。Gets information about the URL of the current request.

UrlReferrer

取得連結至目前 URL 之用戶端要求的 URL 相關資訊。Gets information about the URL of the client request that linked to the current URL.

UserAgent

取得用戶端的完整使用者代理字串。Gets the complete user-agent string of the client.

UserHostAddress

取得用戶端的 IP 主機位址。Gets the IP host address of the client.

UserHostName

取得用戶端的 DNS 名稱。Gets the DNS name of the client.

UserLanguages

取得用戶端語言喜好設定的陣列 (已經過排序)。Gets a sorted array of client language preferences.

方法

Abort()

強制終止造成任何待處理 I/O 失敗的基礎 TCP 連線。Forcibly terminates the underlying TCP connection, causing any outstanding I/O to fail.

Abort()

強制終止造成任何待處理 I/O 失敗的基礎 TCP 連線。Forcibly terminates the underlying TCP connection, causing any outstanding I/O to fail.

(繼承來源 HttpRequestBase)
BinaryRead(Int32)

在目前輸入資料流執行指定位元組數的二進位讀取。Performs a binary read of a specified number of bytes from the current input stream.

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetBufferedInputStream()

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

GetBufferedInputStream()

在衍生類別中實作時,取得 Stream 物件,這個物件可用來讀取傳入 HTTP 實體內容。When implemented in a derived class, gets a Stream object that can be used to read the incoming HTTP entity body.

(繼承來源 HttpRequestBase)
GetBufferlessInputStream()

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

GetBufferlessInputStream()

在衍生類別中實作時,取得 Stream 物件,這個物件可用來讀取傳入 HTTP 實體內容,並選擇性地停用 MaxRequestLength 屬性中所設定的要求長度限制。When implemented in a derived class, gets a Stream object that can be used to read the incoming HTTP entity body, optionally disabling the request length limit that is set in the MaxRequestLength property.

(繼承來源 HttpRequestBase)
GetBufferlessInputStream(Boolean)

取得 Stream 物件,這個物件可用來讀取傳入 HTTP 實體內容,並選擇性地停用 MaxRequestLength 屬性中所設定的要求長度限制。Gets a Stream object that can be used to read the incoming HTTP entity body, , optionally disabling the request length limit that is set in the MaxRequestLength property.

GetBufferlessInputStream(Boolean)

在衍生類別中實作時,取得 Stream 物件,這個物件可用來讀取傳入 HTTP 實體內容,並選擇性地停用 MaxRequestLength 屬性中所設定的要求長度限制。When implemented in a derived class, gets a Stream object that can be used to read the incoming HTTP entity body, optionally disabling the request length limit that is set in the MaxRequestLength property.

(繼承來源 HttpRequestBase)
GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(繼承來源 Object)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
InsertEntityBody()

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

InsertEntityBody()

在衍生類別中實作時,將 HTTP 要求實體內容的複本提供給 IIS。When implemented in a derived class, provides a copy of the HTTP request entity body to IIS.

(繼承來源 HttpRequestBase)
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(Byte[], Int32, Int32)

在衍生類別中實作時,將 HTTP 要求實體內容的複本及該要求實體物件的相關資訊提供給 IIS。When implemented in a derived class, provides IIS with a copy of the HTTP request entity body and with information about the request entity object.

(繼承來源 HttpRequestBase)
MapImageCoordinates(String)

將收到的影像欄的表單參數對應至適當的 X 座標和 Y 座標值。Maps an incoming image-field form parameter to appropriate x-coordinate and y-coordinate values.

MapPath(String)

將指定的虛擬路徑對應至伺服器上的實體路徑。Maps the specified virtual path to a physical path on the server.

MapPath(String, String, Boolean)

將指定的虛擬路徑對應至伺服器上的實體路徑。Maps the specified virtual path to a physical path on the server.

MapRawImageCoordinates(String)

將收到的影像欄的表單參數對應至適當的 X 和 Y 座標值。Maps an incoming image field form parameter into appropriate x and y coordinate values.

MapRawImageCoordinates(String)

將收到的影像欄的表單參數對應至適當的 X 和 Y 座標值。Maps an incoming image field form parameter into appropriate x and y coordinate values.

(繼承來源 HttpRequestBase)
MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)
SaveAs(String, Boolean)

將 HTTP 要求儲存至磁碟。Saves an HTTP request to disk.

ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)
ValidateInput()

會對透過 CookiesFormQueryString 屬性存取的集合進行驗證。Causes validation to occur for the collections that are accessed through the Cookies, Form, and QueryString properties.

適用於