SimpleWorkerRequest 类

定义

提供 HttpWorkerRequest 抽象类的简单实现,该抽象类可用于在 Internet 信息服务 (IIS) 应用程序之外承载 ASP.NET 应用程序。Provides a simple implementation of the HttpWorkerRequest abstract class that can be used to host ASP.NET applications outside an Internet Information Services (IIS) application. 可以直接采用 SimpleWorkerRequest,也可以扩展它。You can employ SimpleWorkerRequest directly or extend it.

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

注解

的这一HttpWorkerRequest简单实现提供请求 URL 和查询字符串, 并将输出的正文捕获TextWriter到中。This simple implementation of HttpWorkerRequest provides the request URL and the query string and captures the body of the output into a TextWriter. 若要实现更丰富的功能 (如提供已发布的内容和标头并将响应标头或响应正文捕获为SimpleWorkerRequest二进制数据), HttpWorkerRequest应扩展和重写适当的方法。To achieve richer functionality, such as providing posted content and headers and capturing the response headers or response body as binary data, you should extend SimpleWorkerRequest and override the appropriate HttpWorkerRequest methods.

构造函数

SimpleWorkerRequest(String, String, String, String, TextWriter)

在用户代码创建 SimpleWorkerRequest 时(将 SimpleWorkerRequest 作为参数传递给 HttpContext 构造函数),初始化 HttpContext 类的新实例,以用于任意应用程序域中。Initializes a new instance of the SimpleWorkerRequest class for use in an arbitrary application domain, when the user code creates an HttpContext (passing the SimpleWorkerRequest as an argument to the HttpContext constructor).

SimpleWorkerRequest(String, String, TextWriter)

在使用 SimpleWorkerRequest 方法创建目标应用程序域之后,初始化 CreateApplicationHost(Type, String, String) 类的新实例。Initializes a new instance of the SimpleWorkerRequest class when the target application domain has been created using the CreateApplicationHost(Type, String, String) method.

字段

HeaderAccept

指定 AcceptHTTP 标头的索引号。Specifies the index number for the Accept HTTP header.

(继承自 HttpWorkerRequest)
HeaderAcceptCharset

指定 Accept-CharsetHTTP 标头的索引号。Specifies the index number for the Accept-Charset HTTP header.

(继承自 HttpWorkerRequest)
HeaderAcceptEncoding

指定 Accept-EncodingHTTP 标头的索引号。Specifies the index number for the Accept-Encoding HTTP header.

(继承自 HttpWorkerRequest)
HeaderAcceptLanguage

指定 Accept-LanguageHTTP 标头的索引号。Specifies the index number for the Accept-Language HTTP header.

(继承自 HttpWorkerRequest)
HeaderAcceptRanges

指定 Accept-RangesHTTP 标头的索引号。Specifies the index number for the Accept-Ranges HTTP header.

(继承自 HttpWorkerRequest)
HeaderAge

指定 AgeHTTP 标头的索引号。Specifies the index number for the Age HTTP header.

(继承自 HttpWorkerRequest)
HeaderAllow

指定 AllowHTTP 标头的索引号。Specifies the index number for the Allow HTTP header.

(继承自 HttpWorkerRequest)
HeaderAuthorization

指定 AuthorizationHTTP 标头的索引号。Specifies the index number for the Authorization HTTP header.

(继承自 HttpWorkerRequest)
HeaderCacheControl

表示 HTTPCache-ControlHTTP 标头的索引。The index that represents the HTTP Cache-Control HTTP header.

(继承自 HttpWorkerRequest)
HeaderConnection

指定 ConnectionHTTP 标头的索引号。Specifies the index number for the Connection HTTP header.

(继承自 HttpWorkerRequest)
HeaderContentEncoding

指定 Content-EncodingHTTP 标头的索引号。Specifies the index number for the Content-Encoding HTTP header.

(继承自 HttpWorkerRequest)
HeaderContentLanguage

指定 Content-LanguageHTTP 标头的索引号。Specifies the index number for the Content-Language HTTP header.

(继承自 HttpWorkerRequest)
HeaderContentLength

指定 Content-LengthHTTP 标头的索引号。Specifies the index number for the Content-Length HTTP header.

(继承自 HttpWorkerRequest)
HeaderContentLocation

指定 Content-LocationHTTP 标头的索引号。Specifies the index number for the Content-Location HTTP header.

(继承自 HttpWorkerRequest)
HeaderContentMd5

指定 Content-MD5HTTP 标头的索引号。Specifies the index number for the Content-MD5 HTTP header.

(继承自 HttpWorkerRequest)
HeaderContentRange

指定 Content-RangeHTTP 标头的索引号。Specifies the index number for the Content-Range HTTP header.

(继承自 HttpWorkerRequest)
HeaderContentType

指定 Content-TypeHTTP 标头的索引号。Specifies the index number for the Content-Type HTTP header.

(继承自 HttpWorkerRequest)
HeaderCookie

指定 CookieHTTP 标头的索引号。Specifies the index number for the Cookie HTTP header.

(继承自 HttpWorkerRequest)
HeaderDate

指定 DateHTTP 标头的索引号。Specifies the index number for the Date HTTP header.

(继承自 HttpWorkerRequest)
HeaderEtag

指定 ETagHTTP 标头的索引号。Specifies the index number for the ETag HTTP header.

(继承自 HttpWorkerRequest)
HeaderExpect

指定 ExceptHTTP 标头的索引号。Specifies the index number for the Except HTTP header.

(继承自 HttpWorkerRequest)
HeaderExpires

指定 ExpiresHTTP 标头的索引号。Specifies the index number for the Expires HTTP header.

(继承自 HttpWorkerRequest)
HeaderFrom

指定 FromHTTP 标头的索引号。Specifies the index number for the From HTTP header.

(继承自 HttpWorkerRequest)
HeaderHost

指定 HostHTTP 标头的索引号。Specifies the index number for the Host HTTP header.

(继承自 HttpWorkerRequest)
HeaderIfMatch

指定 If-MatchHTTP 标头的索引号。Specifies the index number for the If-Match HTTP header.

(继承自 HttpWorkerRequest)
HeaderIfModifiedSince

指定 If-Modified-SinceHTTP 标头的索引号。Specifies the index number for the If-Modified-Since HTTP header.

(继承自 HttpWorkerRequest)
HeaderIfNoneMatch

指定 If-None-MatchHTTP 标头的索引号。Specifies the index number for the If-None-Match HTTP header.

(继承自 HttpWorkerRequest)
HeaderIfRange

指定 If-RangeHTTP 标头的索引号。Specifies the index number for the If-Range HTTP header.

(继承自 HttpWorkerRequest)
HeaderIfUnmodifiedSince

指定 If-Unmodified-SinceHTTP 标头的索引号。Specifies the index number for the If-Unmodified-Since HTTP header.

(继承自 HttpWorkerRequest)
HeaderKeepAlive

指定 Keep-AliveHTTP 标头的索引号。Specifies the index number for the Keep-Alive HTTP header.

(继承自 HttpWorkerRequest)
HeaderLastModified

指定 Last-ModifiedHTTP 标头的索引号。Specifies the index number for the Last-Modified HTTP header.

(继承自 HttpWorkerRequest)
HeaderLocation

指定 LocationHTTP 标头的索引号。Specifies the index number for the Location HTTP header.

(继承自 HttpWorkerRequest)
HeaderMaxForwards

指定 Max-ForwardsHTTP 标头的索引号。Specifies the index number for the Max-Forwards HTTP header.

(继承自 HttpWorkerRequest)
HeaderPragma

指定 PragmaHTTP 标头的索引号。Specifies the index number for the Pragma HTTP header.

(继承自 HttpWorkerRequest)
HeaderProxyAuthenticate

指定 Proxy-AuthenticateHTTP 标头的索引号。Specifies the index number for the Proxy-Authenticate HTTP header.

(继承自 HttpWorkerRequest)
HeaderProxyAuthorization

指定 Proxy-AuthorizationHTTP 标头的索引号。Specifies the index number for the Proxy-Authorization HTTP header.

(继承自 HttpWorkerRequest)
HeaderRange

指定 RangeHTTP 标头的索引号。Specifies the index number for the Range HTTP header.

(继承自 HttpWorkerRequest)
HeaderReferer

指定 RefererHTTP 标头的索引号。Specifies the index number for the Referer HTTP header.

(继承自 HttpWorkerRequest)
HeaderRetryAfter

指定 Retry-AfterHTTP 标头的索引号。Specifies the index number for the Retry-After HTTP header.

(继承自 HttpWorkerRequest)
HeaderServer

指定 ServerHTTP 标头的索引号。Specifies the index number for the Server HTTP header.

(继承自 HttpWorkerRequest)
HeaderSetCookie

指定 Set-CookieHTTP 标头的索引号。Specifies the index number for the Set-Cookie HTTP header.

(继承自 HttpWorkerRequest)
HeaderTe

指定 TEHTTP 标头的索引号。Specifies the index number for the TE HTTP header.

(继承自 HttpWorkerRequest)
HeaderTrailer

指定 TrailerHTTP 标头的索引号。Specifies the index number for the Trailer HTTP header.

(继承自 HttpWorkerRequest)
HeaderTransferEncoding

指定 Transfer-EncodingHTTP 标头的索引号。Specifies the index number for the Transfer-Encoding HTTP header.

(继承自 HttpWorkerRequest)
HeaderUpgrade

指定 UpgradeHTTP 标头的索引号。Specifies the index number for the Upgrade HTTP header.

(继承自 HttpWorkerRequest)
HeaderUserAgent

指定 User-AgentHTTP 标头的索引号。Specifies the index number for the User-Agent HTTP header.

(继承自 HttpWorkerRequest)
HeaderVary

指定 VaryHTTP 标头的索引号。Specifies the index number for the Vary HTTP header.

(继承自 HttpWorkerRequest)
HeaderVia

指定 ViaHTTP 标头的索引号。Specifies the index number for the Via HTTP header.

(继承自 HttpWorkerRequest)
HeaderWarning

指定 WarningHTTP 标头的索引号。Specifies the index number for the Warning HTTP header.

(继承自 HttpWorkerRequest)
HeaderWwwAuthenticate

指定 WWW-AuthenticateHTTP 标头的索引号。Specifies the index number for the WWW-Authenticate HTTP header.

(继承自 HttpWorkerRequest)
ReasonCachePolicy

指定请求的原因。Specifies a reason for the request.

(继承自 HttpWorkerRequest)
ReasonCacheSecurity

指定请求的原因。Specifies a reason for the request.

(继承自 HttpWorkerRequest)
ReasonClientDisconnect

指定请求的原因。Specifies a reason for the request.

(继承自 HttpWorkerRequest)
ReasonDefault

指定请求的原因。Specifies a reason for the request. 默认值是 ReasonResponseCacheMissThe default value is ReasonResponseCacheMiss.

(继承自 HttpWorkerRequest)
ReasonFileHandleCacheMiss

指定请求的原因。Specifies a reason for the request.

(继承自 HttpWorkerRequest)
ReasonResponseCacheMiss

指定请求的原因。Specifies a reason for the request.

(继承自 HttpWorkerRequest)
RequestHeaderMaximum

指定 MaximumHTTP 请求标头的索引号。Specifies the index number for the Maximum HTTP request header.

(继承自 HttpWorkerRequest)
ResponseHeaderMaximum

指定 MaximumHTTP 响应标头的索引号。Specifies the index number for the Maximum HTTP response header.

(继承自 HttpWorkerRequest)

属性

MachineConfigPath

获取 Machine.config 文件的完整物理路径。Gets the full physical path to the Machine.config file.

MachineInstallDirectory

获取 ASP.NET 二进制文件的安装目录的物理路径。Gets the physical path to the directory where the ASP.NET binaries are installed.

RequestTraceIdentifier

获取当前请求的 Windows 跟踪 ID 的相应事件跟踪。Gets the corresponding Event Tracking for Windows trace ID for the current request.

(继承自 HttpWorkerRequest)
RootWebConfigPath

获取根 Web.config 文件的完整物理路径。Gets the full physical path to the root Web.config file.

SupportsAsyncFlush

获取一个值,该值指示是否支持异步刷新操作。Gets a value that indicates whether asynchronous flush operations are supported.

(继承自 HttpWorkerRequest)
SupportsAsyncRead

获取一个值,该值指示是否支持异步读取操作。Gets a value that indicates whether asynchronous read operations are supported.

(继承自 HttpWorkerRequest)

方法

BeginFlush(AsyncCallback, Object)

向客户端发送当前所有缓冲的响应。Sends the currently buffered response to the client.

(继承自 HttpWorkerRequest)
BeginRead(Byte[], Int32, Int32, AsyncCallback, Object)

启动请求的实体正文中的一次异步读取操作。Begins an asynchronous read operation of the request entity body.

(继承自 HttpWorkerRequest)
CloseConnection()

终止与客户端的连接。Terminates the connection with the client.

(继承自 HttpWorkerRequest)
EndFlush(IAsyncResult)

等待挂起的异步刷新操作完成。Waits for the pending asynchronous flush operation to complete.

(继承自 HttpWorkerRequest)
EndOfRequest()

通知 HttpWorkerRequest 当前请求的请求处理已完成。Notifies the HttpWorkerRequest that request processing for the current request is complete.

EndRead(IAsyncResult)

等待挂起的异步读操作完成。Waits for the pending asynchronous read operation to complete.

(继承自 HttpWorkerRequest)
Equals(Object)

确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
FlushResponse(Boolean)

将所有挂起的响应数据发送到客户端。Sends all pending response data to the client.

GetAppPath()

返回当前正在执行的服务器应用程序的虚拟路径。Returns the virtual path to the currently executing server application.

GetAppPathTranslated()

返回当前正在执行的服务器应用程序的 UNC 翻译路径。Returns the UNC-translated path to the currently executing server application.

GetAppPoolID()

在派生类中被重写时,返回当前 URL 的应用程序池 ID。When overridden in a derived class, returns the application pool ID for the current URL.

(继承自 HttpWorkerRequest)
GetBytesRead()

获取从客户端读入的字节数。Gets the number of bytes read in from the client.

(继承自 HttpWorkerRequest)
GetClientCertificate()

在派生类中被重写时,从客户端发出的请求获取证书字段(以 X.509 标准指定)。When overridden in a derived class, gets the certification fields (specified in the X.509 standard) from a request issued by the client.

(继承自 HttpWorkerRequest)
GetClientCertificateBinaryIssuer()

获取二进制格式的证书颁发者。Gets the certificate issuer, in binary format.

(继承自 HttpWorkerRequest)
GetClientCertificateEncoding()

在派生类中被重写时,返回用于编码客户端证书的 Encoding 对象。When overridden in a derived class, returns the Encoding object in which the client certificate was encoded.

(继承自 HttpWorkerRequest)
GetClientCertificatePublicKey()

在派生类中被重写时,获取与客户端证书关联的 PublicKey 对象。When overridden in a derived class, gets a PublicKey object associated with the client certificate.

(继承自 HttpWorkerRequest)
GetClientCertificateValidFrom()

在派生类中被重写时,则获取证书开始生效的日期。When overridden in a derived class, gets the date when the certificate becomes valid. 该日期因国际设置而异。The date varies with international settings.

(继承自 HttpWorkerRequest)
GetClientCertificateValidUntil()

获取证书过期日期。Gets the certificate expiration date.

(继承自 HttpWorkerRequest)
GetConnectionID()

在派生类中被重写时,返回当前连接的 ID。When overridden in a derived class, returns the ID of the current connection.

(继承自 HttpWorkerRequest)
GetFilePath()

返回请求的 URI 的物理路径。Returns the physical path to the requested URI.

GetFilePathTranslated()

返回请求的 URI 的物理文件路径(并将其从虚拟路径转换成物理路径:例如,从“/proj1/page.aspx”转换成“c:\dir\page.aspx”)Returns the physical file path to the requested URI (and translates it from virtual path to physical path: for example, "/proj1/page.aspx" to "c:\dir\page.aspx")

GetHashCode()

用作默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetHttpVerbName()

返回 HTTP 请求谓词。Returns the HTTP request verb.

GetHttpVersion()

返回请求的 HTTP 版本字符串(例如“HTTP/1.1”)。Returns the HTTP version string of the request (for example, "HTTP/1.1").

GetKnownRequestHeader(Int32)

返回对应于指定索引的标准 HTTP 请求标头。Returns the standard HTTP request header that corresponds to the specified index.

(继承自 HttpWorkerRequest)
GetLocalAddress()

返回收到请求的接口的服务器 IP 地址。Returns the server IP address of the interface on which the request was received.

GetLocalPort()

返回收到请求的端口号。Returns the port number on which the request was received.

GetPathInfo()

返回具有 URL 扩展的资源的其他路径信息。Returns additional path information for a resource with a URL extension. 即对于路径 /virdir/page.html/tail,返回值为 /tail。That is, for the path /virdir/page.html/tail, the return value is /tail.

GetPreloadedEntityBody()

返回已读取的 HTTP 请求正文部分。Returns the portion of the HTTP request body that has already been read.

(继承自 HttpWorkerRequest)
GetPreloadedEntityBody(Byte[], Int32)

获取当前已通过指定的缓冲区数据和字节偏移读取的 HTTP 请求正文部分。Gets the portion of the HTTP request body that has currently been read by using the specified buffer data and byte offset.

(继承自 HttpWorkerRequest)
GetPreloadedEntityBodyLength()

返回当前已读取的 HTTP 请求正文部分的长度。Gets the length of the portion of the HTTP request body that has currently been read.

(继承自 HttpWorkerRequest)
GetProtocol()

在派生类中被重写时,返回 HTTP 协议(HTTP 或 HTTPS)。When overridden in a derived class, returns the HTTP protocol (HTTP or HTTPS).

(继承自 HttpWorkerRequest)
GetQueryString()

返回请求 URL 中指定的查询字符串。Returns the query string specified in the request URL.

GetQueryStringRawBytes()

在派生类中被重写时,以字节数组的形式返回响应查询字符串。When overridden in a derived class, returns the response query string as an array of bytes.

(继承自 HttpWorkerRequest)
GetRawUrl()

返回附加了查询字符串的请求标头中包含的 URL 路径。Returns the URL path contained in the header with the query string appended.

GetRemoteAddress()

返回客户端的 IP 地址。Returns the IP address of the client.

GetRemoteName()

在派生类中被重写时,返回客户端计算机的名称。When overridden in a derived class, returns the name of the client computer.

(继承自 HttpWorkerRequest)
GetRemotePort()

返回客户端的端口号。Returns the client's port number.

GetRequestReason()

在派生类中被重写时,返回请求的原因。When overridden in a derived class, returns the reason for the request.

(继承自 HttpWorkerRequest)
GetServerName()

在派生类中被重写时,返回本地服务器的名称。When overridden in a derived class, returns the name of the local server.

(继承自 HttpWorkerRequest)
GetServerVariable(String)

从与请求关联的服务器变量词典返回单个服务器变量。Returns a single server variable from a dictionary of server variables associated with the request.

GetTotalEntityBodyLength()

获取整个 HTTP 请求正文的长度。Gets the length of the entire HTTP request body.

(继承自 HttpWorkerRequest)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
GetUnknownRequestHeader(String)

返回非标准 HTTP 请求标头值。Returns a nonstandard HTTP request header value.

(继承自 HttpWorkerRequest)
GetUnknownRequestHeaders()

获取所有非标准 HTTP 标头名称-值对。Get all nonstandard HTTP header name-value pairs.

(继承自 HttpWorkerRequest)
GetUriPath()

返回请求的 URI 的虚拟路径。Returns the virtual path to the requested URI.

GetUrlContextID()

当在派生类中被重写时,返回当前连接的上下文 ID。When overridden in a derived class, returns the context ID of the current connection.

(继承自 HttpWorkerRequest)
GetUserToken()

返回客户端的模拟标记。Returns the client's impersonation token.

GetVirtualPathToken()

获取请求虚拟路径的模拟标记。Gets the impersonation token for the request virtual path.

(继承自 HttpWorkerRequest)
HasEntityBody()

返回一个值,该值指示请求是否包含正文数据。Returns a value indicating whether the request contains body data.

(继承自 HttpWorkerRequest)
HeadersSent()

返回一个值,该值指示是否已将 HTTP 响应标头发送到当前请求的客户端。Returns a value indicating whether HTTP response headers have been sent to the client for the current request.

(继承自 HttpWorkerRequest)
IsClientConnected()

返回一个值,该值指示客户端连接是否仍处于活动状态。Returns a value indicating whether the client connection is still active.

(继承自 HttpWorkerRequest)
IsEntireEntityBodyIsPreloaded()

返回一个值,该值指示是否所有请求数据都可用,并且无需从客户端中进一步读取数据。Returns a value indicating whether all request data is available and no further reads from the client are required.

(继承自 HttpWorkerRequest)
IsSecure()

返回一个值,该值指示连接是否使用 SSL。Returns a value indicating whether the connection uses SSL.

(继承自 HttpWorkerRequest)
MapPath(String)

返回与指定虚拟路径相对应的物理路径。Returns the physical path corresponding to the specified virtual path.

MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
ReadEntityBody(Byte[], Int32)

从客户端读取请求数据(当未预先加载时)。Reads request data from the client (when not preloaded).

(继承自 HttpWorkerRequest)
ReadEntityBody(Byte[], Int32, Int32)

使用要从中读取内容的指定缓冲区、字节偏移和最大字节数,从客户端读取请求数据(当未预先加载时)。Reads request data from the client (when not preloaded) by using the specified buffer to read from, byte offset, and maximum bytes.

(继承自 HttpWorkerRequest)
SendCalculatedContentLength(Int32)

Content-Length HTTP 标头添加到小于或等于 2 GB 的消息正文的响应。Adds a Content-Length HTTP header to the response for message bodies that are less than or equal to 2 GB.

(继承自 HttpWorkerRequest)
SendCalculatedContentLength(Int64)

Content-Length HTTP 标头添加到大于 2 GB 的消息正文的响应。Adds a Content-Length HTTP header to the response for message bodies that are greater than 2 GB.

(继承自 HttpWorkerRequest)
SendKnownResponseHeader(Int32, String)

将标准 HTTP 标头添加到响应。Adds a standard HTTP header to the response.

SendResponseFromFile(IntPtr, Int64, Int64)

将具有指定句柄的文件的内容添加到响应并指定文件中的起始位置和要发送的字节数。Adds the contents of the file with the specified handle to the response and specifies the starting position in the file and the number of bytes to send.

SendResponseFromFile(String, Int64, Int64)

将具有指定名称的文件的内容添加到响应并指定文件中的起始位置和要发送的字节数。Adds the contents of the file with the specified name to the response and specifies the starting position in the file and the number of bytes to send.

SendResponseFromMemory(Byte[], Int32)

将字节数组的内容添加到响应并指定要发送的字节数。Adds the contents of a byte array to the response and specifies the number of bytes to send.

SendResponseFromMemory(IntPtr, Int32)

将内存块中的指定字节数添加到响应。Adds the specified number of bytes from a block of memory to the response.

(继承自 HttpWorkerRequest)
SendStatus(Int32, String)

指定响应的 HTTP 状态代码和状态说明;例如 SendStatus(200, "Ok")。Specifies the HTTP status code and status description of the response; for example, SendStatus(200, "Ok").

SendUnknownResponseHeader(String, String)

将非标准 HTTP 标头添加到响应。Adds a nonstandard HTTP header to the response.

SetEndOfSendNotification(HttpWorkerRequest+EndOfSendNotification, Object)

发送所有响应数据后注册可选通知。Registers for an optional notification when all the response data is sent.

(继承自 HttpWorkerRequest)
ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)

适用于