SimpleWorkerRequest 類別

定義

提供一個簡單的 HttpWorkerRequest 抽象類別實作,可用於在 Internet Information Services(IIS)應用程式之外託管 ASP.NET 應用程式。 你可以直接聘用 SimpleWorkerRequest 或延長。

public ref class SimpleWorkerRequest : System::Web::HttpWorkerRequest
[System.Runtime.InteropServices.ComVisible(false)]
public class SimpleWorkerRequest : System.Web.HttpWorkerRequest
[<System.Runtime.InteropServices.ComVisible(false)>]
type SimpleWorkerRequest = class
    inherit HttpWorkerRequest
Public Class SimpleWorkerRequest
Inherits HttpWorkerRequest
繼承
SimpleWorkerRequest
屬性

備註

此簡單的實作 HttpWorkerRequest 提供請求 URL 與查詢字串,並將輸出主體擷取為 TextWriter。 為了實現更豐富的功能,例如提供已發佈內容和標頭,並以二進位資料擷取回應標頭或回應內容,你應該擴充 SimpleWorkerRequest 並覆蓋適當的 HttpWorkerRequest 方法。

建構函式

名稱 Description
SimpleWorkerRequest(String, String, String, String, TextWriter)

當使用者程式碼建立HttpContext一個(將 作為SimpleWorkerRequest參數傳遞給HttpContext建構子)時,初始化該SimpleWorkerRequest類別的新實例以用於任意應用域。

SimpleWorkerRequest(String, String, TextWriter)

當目標應用域已使用該CreateApplicationHost(Type, String, String)方法建立後,初始化該類別的新SimpleWorkerRequest實例。

欄位

名稱 Description
HeaderAccept

指定 HTTP 標頭的 Accept 索引號。

(繼承來源 HttpWorkerRequest)
HeaderAcceptCharset

指定 HTTP 標頭的 Accept-Charset 索引號。

(繼承來源 HttpWorkerRequest)
HeaderAcceptEncoding

指定 HTTP 標頭的 Accept-Encoding 索引號。

(繼承來源 HttpWorkerRequest)
HeaderAcceptLanguage

指定 HTTP 標頭的 Accept-Language 索引號。

(繼承來源 HttpWorkerRequest)
HeaderAcceptRanges

指定 HTTP 標頭的 Accept-Ranges 索引號。

(繼承來源 HttpWorkerRequest)
HeaderAge

指定 HTTP 標頭的 Age 索引號。

(繼承來源 HttpWorkerRequest)
HeaderAllow

指定 HTTP 標頭的 Allow 索引號。

(繼承來源 HttpWorkerRequest)
HeaderAuthorization

指定 HTTP 標頭的 Authorization 索引號。

(繼承來源 HttpWorkerRequest)
HeaderCacheControl

代表 HTTP Cache-Control HTTP 標頭的索引。

(繼承來源 HttpWorkerRequest)
HeaderConnection

指定 HTTP 標頭的 Connection 索引號。

(繼承來源 HttpWorkerRequest)
HeaderContentEncoding

指定 HTTP 標頭的 Content-Encoding 索引號。

(繼承來源 HttpWorkerRequest)
HeaderContentLanguage

指定 HTTP 標頭的 Content-Language 索引號。

(繼承來源 HttpWorkerRequest)
HeaderContentLength

指定 HTTP 標頭的 Content-Length 索引號。

(繼承來源 HttpWorkerRequest)
HeaderContentLocation

指定 HTTP 標頭的 Content-Location 索引號。

(繼承來源 HttpWorkerRequest)
HeaderContentMd5

指定 HTTP 標頭的 Content-MD5 索引號。

(繼承來源 HttpWorkerRequest)
HeaderContentRange

指定 HTTP 標頭的 Content-Range 索引號。

(繼承來源 HttpWorkerRequest)
HeaderContentType

指定 HTTP 標頭的 Content-Type 索引號。

(繼承來源 HttpWorkerRequest)
HeaderCookie

指定 HTTP 標頭的 Cookie 索引號。

(繼承來源 HttpWorkerRequest)
HeaderDate

指定 HTTP 標頭的 Date 索引號。

(繼承來源 HttpWorkerRequest)
HeaderEtag

指定 HTTP 標頭的 ETag 索引號。

(繼承來源 HttpWorkerRequest)
HeaderExpect

指定 HTTP 標頭的 Except 索引號。

(繼承來源 HttpWorkerRequest)
HeaderExpires

指定 HTTP 標頭的 Expires 索引號。

(繼承來源 HttpWorkerRequest)
HeaderFrom

指定 HTTP 標頭的 From 索引號。

(繼承來源 HttpWorkerRequest)
HeaderHost

指定 HTTP 標頭的 Host 索引號。

(繼承來源 HttpWorkerRequest)
HeaderIfMatch

指定 HTTP 標頭的 If-Match 索引號。

(繼承來源 HttpWorkerRequest)
HeaderIfModifiedSince

指定 HTTP 標頭的 If-Modified-Since 索引號。

(繼承來源 HttpWorkerRequest)
HeaderIfNoneMatch

指定 HTTP 標頭的 If-None-Match 索引號。

(繼承來源 HttpWorkerRequest)
HeaderIfRange

指定 HTTP 標頭的 If-Range 索引號。

(繼承來源 HttpWorkerRequest)
HeaderIfUnmodifiedSince

指定 HTTP 標頭的 If-Unmodified-Since 索引號。

(繼承來源 HttpWorkerRequest)
HeaderKeepAlive

指定 HTTP 標頭的 Keep-Alive 索引號。

(繼承來源 HttpWorkerRequest)
HeaderLastModified

指定 HTTP 標頭的 Last-Modified 索引號。

(繼承來源 HttpWorkerRequest)
HeaderLocation

指定 HTTP 標頭的 Location 索引號。

(繼承來源 HttpWorkerRequest)
HeaderMaxForwards

指定 HTTP 標頭的 Max-Forwards 索引號。

(繼承來源 HttpWorkerRequest)
HeaderPragma

指定 HTTP 標頭的 Pragma 索引號。

(繼承來源 HttpWorkerRequest)
HeaderProxyAuthenticate

指定 HTTP 標頭的 Proxy-Authenticate 索引號。

(繼承來源 HttpWorkerRequest)
HeaderProxyAuthorization

指定 HTTP 標頭的 Proxy-Authorization 索引號。

(繼承來源 HttpWorkerRequest)
HeaderRange

指定 HTTP 標頭的 Range 索引號。

(繼承來源 HttpWorkerRequest)
HeaderReferer

指定 HTTP 標頭的 Referer 索引號。

(繼承來源 HttpWorkerRequest)
HeaderRetryAfter

指定 HTTP 標頭的 Retry-After 索引號。

(繼承來源 HttpWorkerRequest)
HeaderServer

指定 HTTP 標頭的 Server 索引號。

(繼承來源 HttpWorkerRequest)
HeaderSetCookie

指定 HTTP 標頭的 Set-Cookie 索引號。

(繼承來源 HttpWorkerRequest)
HeaderTe

指定 HTTP 標頭的 TE 索引號。

(繼承來源 HttpWorkerRequest)
HeaderTrailer

指定 HTTP 標頭的 Trailer 索引號。

(繼承來源 HttpWorkerRequest)
HeaderTransferEncoding

指定 HTTP 標頭的 Transfer-Encoding 索引號。

(繼承來源 HttpWorkerRequest)
HeaderUpgrade

指定 HTTP 標頭的 Upgrade 索引號。

(繼承來源 HttpWorkerRequest)
HeaderUserAgent

指定 HTTP 標頭的 User-Agent 索引號。

(繼承來源 HttpWorkerRequest)
HeaderVary

指定 HTTP 標頭的 Vary 索引號。

(繼承來源 HttpWorkerRequest)
HeaderVia

指定 HTTP 標頭的 Via 索引號。

(繼承來源 HttpWorkerRequest)
HeaderWarning

指定 HTTP 標頭的 Warning 索引號。

(繼承來源 HttpWorkerRequest)
HeaderWwwAuthenticate

指定 HTTP 標頭的 WWW-Authenticate 索引號。

(繼承來源 HttpWorkerRequest)
ReasonCachePolicy

說明請求的理由。

(繼承來源 HttpWorkerRequest)
ReasonCacheSecurity

說明請求的理由。

(繼承來源 HttpWorkerRequest)
ReasonClientDisconnect

說明請求的理由。

(繼承來源 HttpWorkerRequest)
ReasonDefault

說明請求的理由。 預設值為 ReasonResponseCacheMiss

(繼承來源 HttpWorkerRequest)
ReasonFileHandleCacheMiss

說明請求的理由。

(繼承來源 HttpWorkerRequest)
ReasonResponseCacheMiss

說明請求的理由。

(繼承來源 HttpWorkerRequest)
RequestHeaderMaximum

指定 HTTP 請求標頭的 Maximum 索引號。

(繼承來源 HttpWorkerRequest)
ResponseHeaderMaximum

指定 HTTP 回應標頭的 Maximum 索引號。

(繼承來源 HttpWorkerRequest)

屬性

名稱 Description
MachineConfigPath

取得完整的實體路徑到 Machine.config 檔案。

MachineInstallDirectory

取得安裝 ASP.NET 二進位檔的目錄的實體路徑。

RequestTraceIdentifier

取得對應的 Windows 事件追蹤追蹤 ID,針對目前請求。

(繼承來源 HttpWorkerRequest)
RootWebConfigPath

取得根 Web.config 檔案的完整物理路徑。

SupportsAsyncFlush

會得到一個值,表示是否支援非同步沖洗操作。

(繼承來源 HttpWorkerRequest)
SupportsAsyncRead

會獲得一個值,表示是否支援非同步讀取操作。

(繼承來源 HttpWorkerRequest)

方法

名稱 Description
BeginFlush(AsyncCallback, Object)

將目前緩衝的回應傳送給用戶端。

(繼承來源 HttpWorkerRequest)
BeginRead(Byte[], Int32, Int32, AsyncCallback, Object)

開始對請求實體實體進行非同步讀取操作。

(繼承來源 HttpWorkerRequest)
CloseConnection()

終止與客戶端的連線。

(繼承來源 HttpWorkerRequest)
EndFlush(IAsyncResult)

等待即將完成的非同步沖洗操作。

(繼承來源 HttpWorkerRequest)
EndOfRequest()

通知 HttpWorkerRequest 該請求目前的處理已完成。

EndRead(IAsyncResult)

等待即將完成的非同步讀取操作。

(繼承來源 HttpWorkerRequest)
Equals(Object)

判斷指定的 物件是否等於目前的物件。

(繼承來源 Object)
FlushResponse(Boolean)

將所有待處理的回應資料傳送給用戶端。

GetAppPath()

回傳目前執行中的伺服器應用程式的虛擬路徑。

GetAppPathTranslated()

將 UNC 轉換路徑回傳至目前執行中的伺服器應用程式。

GetAppPoolID()

當在衍生類別中覆寫時,會回傳當前 URL 的應用程式池 ID。

(繼承來源 HttpWorkerRequest)
GetBytesRead()

取得從用戶端讀取的位元組數。

(繼承來源 HttpWorkerRequest)
GetClientCertificate()

當在衍生類別中被覆寫時,會從客戶端發出的請求中取得 X.509 標準中指定的認證欄位。

(繼承來源 HttpWorkerRequest)
GetClientCertificateBinaryIssuer()

取得憑證發行者,二進位格式。

(繼承來源 HttpWorkerRequest)
GetClientCertificateEncoding()

當在衍生類別中覆寫時,會回傳 Encoding 客戶端憑證所編碼的物件。

(繼承來源 HttpWorkerRequest)
GetClientCertificatePublicKey()

當在衍生類別中覆寫時,會獲得 PublicKey 與客戶端憑證相關的物件。

(繼承來源 HttpWorkerRequest)
GetClientCertificateValidFrom()

當在衍生類別中被覆寫時,會取得憑證生效的日期。 日期會因國際場合而異。

(繼承來源 HttpWorkerRequest)
GetClientCertificateValidUntil()

會拿到證書到期日。

(繼承來源 HttpWorkerRequest)
GetConnectionID()

當在衍生類別中覆寫時,會回傳目前連線的 ID。

(繼承來源 HttpWorkerRequest)
GetFilePath()

回傳到所請求的 URI 的實體路徑。

GetFilePathTranslated()

回傳實體檔案路徑至所請求的 URI(並將虛擬路徑轉換為實體路徑:例如,「/proj1/page.aspx」轉為「c:\dir\page.aspx」)

GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetHttpVerbName()

回傳 HTTP 請求動詞。

GetHttpVersion()

回傳請求的 HTTP 版本字串(例如「HTTP/1.1」)。

GetKnownRequestHeader(Int32)

回傳對應指定索引的標準 HTTP 請求標頭。

(繼承來源 HttpWorkerRequest)
GetLocalAddress()

回傳接收請求時介面的伺服器 IP 位址。

GetLocalPort()

回傳收到請求的埠號。

GetPathInfo()

回傳具有 URL 副檔名的資源的額外路徑資訊。 也就是說,對於路徑 /virdir/page.html/tail,回傳值為 /tail。

GetPreloadedEntityBody()

回傳已讀取的 HTTP 請求主體部分。

(繼承來源 HttpWorkerRequest)
GetPreloadedEntityBody(Byte[], Int32)

取得目前已透過指定的緩衝區資料和位元組偏移量讀取的 HTTP 請求主體部分。

(繼承來源 HttpWorkerRequest)
GetPreloadedEntityBodyLength()

取得目前已讀取的 HTTP 請求主體部分的長度。

(繼承來源 HttpWorkerRequest)
GetProtocol()

當在派生類別中覆寫時,會回傳 HTTP 協定(HTTP 或 HTTPS)。

(繼承來源 HttpWorkerRequest)
GetQueryString()

回傳請求 URL 中指定的查詢字串。

GetQueryStringRawBytes()

當在派生類別中覆寫時,會以位元組陣列的形式回傳回應查詢字串。

(繼承來源 HttpWorkerRequest)
GetRawUrl()

回傳標頭中包含的 URL 路徑,並附加查詢字串。

GetRemoteAddress()

回傳客戶端的 IP 位址。

GetRemoteName()

當在衍生類別中覆寫時,會回傳客戶端電腦的名稱。

(繼承來源 HttpWorkerRequest)
GetRemotePort()

回傳客戶端的埠號。

GetRequestReason()

當在衍生類別中被覆寫時,會回傳請求的理由。

(繼承來源 HttpWorkerRequest)
GetServerName()

當在派生類別中覆寫時,會回傳本地伺服器的名稱。

(繼承來源 HttpWorkerRequest)
GetServerVariable(String)

從與請求相關的伺服器變數字典中回傳一個伺服器變數。

GetTotalEntityBodyLength()

取得整個 HTTP 請求體的長度。

(繼承來源 HttpWorkerRequest)
GetType()

取得目前實例的 Type

(繼承來源 Object)
GetUnknownRequestHeader(String)

回傳非標準 HTTP 請求標頭值。

(繼承來源 HttpWorkerRequest)
GetUnknownRequestHeaders()

取得所有非標準 HTTP 標頭名稱與值對。

(繼承來源 HttpWorkerRequest)
GetUriPath()

回傳虛擬路徑至所請求的 URI。

GetUrlContextID()

當在衍生類別中覆寫時,會回傳當前連線的上下文 ID。

(繼承來源 HttpWorkerRequest)
GetUserToken()

還原客戶的冒充代幣。

GetVirtualPathToken()

取得請求虛擬路徑的模擬令牌。

(繼承來源 HttpWorkerRequest)
HasEntityBody()

回傳一個值,指示請求是否包含主體資料。

(繼承來源 HttpWorkerRequest)
HeadersSent()

回傳一個值,表示目前請求是否已向用戶端發送 HTTP 回應標頭。

(繼承來源 HttpWorkerRequest)
IsClientConnected()

回傳一個值,表示用戶端連線是否仍在運作中。

(繼承來源 HttpWorkerRequest)
IsEntireEntityBodyIsPreloaded()

回傳一個值,表示所有請求資料是否可用,且用戶端不再需要讀取。

(繼承來源 HttpWorkerRequest)
IsSecure()

回傳一個值,表示連線是否使用 SSL。

(繼承來源 HttpWorkerRequest)
MapPath(String)

回傳對應於指定虛擬路徑的物理路徑。

MemberwiseClone()

建立目前 Object的淺層複本。

(繼承來源 Object)
ReadEntityBody(Byte[], Int32, Int32)

在未預載時,透過指定的緩衝區讀取請求資料、位元組偏移量及最大位元組。

(繼承來源 HttpWorkerRequest)
ReadEntityBody(Byte[], Int32)

讀取用戶端的請求資料(當未預載時)。

(繼承來源 HttpWorkerRequest)
SendCalculatedContentLength(Int32)

對於大小不大於 2 GB 的訊息主體,會在 Content-Length 回應中加入 HTTP 標頭。

(繼承來源 HttpWorkerRequest)
SendCalculatedContentLength(Int64)

對於超過 2 GB 的訊息主體,會在 Content-Length 回應中加入 HTTP 標頭。

(繼承來源 HttpWorkerRequest)
SendKnownResponseHeader(Int32, String)

在回應中加入標準的 HTTP 標頭。

SendResponseFromFile(IntPtr, Int64, Int64)

將指定帳號的檔案內容加入回應,並指定檔案起始位置及要傳送的位元組數。

SendResponseFromFile(String, Int64, Int64)

將指定名稱的檔案內容加入回應,並指定檔案起始位置及要傳送的位元組數。

SendResponseFromMemory(Byte[], Int32)

將位元組陣列的內容加入回應,並指定要傳送的位元組數量。

SendResponseFromMemory(IntPtr, Int32)

將指定數量的記憶體區塊加入回應。

(繼承來源 HttpWorkerRequest)
SendStatus(Int32, String)

指定回應的 HTTP 狀態碼與狀態描述;例如,SendStatus(200, “Ok”)。

SendUnknownResponseHeader(String, String)

在回應中加入非標準的 HTTP 標頭。

SetEndOfSendNotification(HttpWorkerRequest+EndOfSendNotification, Object)

當所有回應資料傳送完畢時,會註冊以接收可選通知。

(繼承來源 HttpWorkerRequest)
ToString()

傳回表示目前 物件的字串。

(繼承來源 Object)

適用於