HttpResponseWrapper 类
定义
封装 HTTP 内部对象,该对象提供来自 ASP.NET 操作的 HTTP 响应信息。Encapsulates the HTTP intrinsic object that provides HTTP-response information from an ASP.NET operation.
public ref class HttpResponseWrapper : System::Web::HttpResponseBase
public class HttpResponseWrapper : System.Web.HttpResponseBase
type HttpResponseWrapper = class
inherit HttpResponseBase
Public Class HttpResponseWrapper
Inherits HttpResponseBase
- 继承
注解
HttpResponseWrapper类派生自 HttpResponseBase 类,用作类的包装 HttpResponse 。The HttpResponseWrapper class derives from the HttpResponseBase class and serves as a wrapper for the HttpResponse class. 此类公开类的功能, HttpResponse 同时公开 HttpResponseBase 类型。This class exposes the functionality of the HttpResponse class while also exposing the HttpResponseBase type. HttpResponseBase通过类,可以将应用程序中类的原始实现替换为 HttpResponse 自定义实现,例如在 ASP.NET 管道之外执行单元测试时。The HttpResponseBase class enables you to replace the original implementation of the HttpResponse class in your application with a custom implementation, such as when you perform unit testing outside the ASP.NET pipeline.
构造函数
| HttpResponseWrapper(HttpResponse) |
初始化 HttpResponseWrapper 类的新实例。Initializes a new instance of the HttpResponseWrapper class. |
属性
| Buffer |
获取或设置一个值,该值指示是否缓冲输出并在整个响应结束处理后发送该输出。Gets or sets a value that indicates whether to buffer output and send it after the complete response has finished processing. |
| BufferOutput |
获取或设置一个值,该值指示是否缓冲输出并在整个页面结束处理后发送该输出。Gets or sets a value that indicates whether to buffer output and send it after the complete page has finished processing. |
| Cache |
获取当前网页的缓存策略(如过期时间、隐私设置和 vary 子句)。Gets the caching policy (such as expiration time, privacy settings, and vary clauses) of the current Web page. |
| CacheControl |
获取或设置与 HttpCacheability 枚举值之一匹配的 |
| Charset |
获取或设置当前响应的 HTTP 字符集。Gets or sets the HTTP character set of the current response. |
| ClientDisconnectedToken |
获取客户端断开连接时触发的 CancellationToken 对象。Gets a CancellationToken object that is tripped when the client disconnects. |
| ClientDisconnectedToken |
获取客户端断开连接时触发的 CancellationToken 对象。Gets a CancellationToken object that is tripped when the client disconnects. (继承自 HttpResponseBase) |
| ContentEncoding |
获取或设置当前响应的内容编码。Gets or sets the content encoding of the current response. |
| ContentType |
获取或设置当前响应的 HTTP MIME 类型。Gets or sets the HTTP MIME type of the current response. |
| Cookies |
获取响应 cookie 集合。Gets the response cookie collection. |
| Expires |
获取或设置在客户端或代理上缓存的页面过期之前的分钟数。Gets or sets the number of minutes before a page that is cached on the client or proxy expires. 如果用户在页面过期之前返回到该页,则显示缓存的版本。If the user returns to the same page before it expires, the cached version is displayed. 提供 Expires,以便兼容 ASP 的早期版本。Expires is provided for compatibility with earlier versions of ASP. |
| ExpiresAbsolute |
获取或设置一个绝对日期和时间,该时间点之后,缓存信息在缓存中过期。Gets or sets the absolute date and time at which cached information expires in the cache. 提供 ExpiresAbsolute,以便兼容 ASP 的早期版本。ExpiresAbsolute is provided for compatibility with earlier versions of ASP. |
| Filter |
获取或设置用于在传输之前修改 HTTP 实体正文的筛选器对象。Gets or sets a filter object that is used to modify the HTTP entity body before transmission. |
| HeaderEncoding |
获取或设置当前响应的标头的编码。Gets or sets the encoding for the header of the current response. |
| Headers |
获取响应标头的集合。Gets the collection of response headers. |
| HeadersWritten |
获取指示是否已写入响应标头的值。Gets a value indicating whether the response headers have been written. |
| HeadersWritten |
获取指示是否已写入响应标头的值。Gets a value indicating whether the response headers have been written. (继承自 HttpResponseBase) |
| IsClientConnected |
获取一个值,该值指示客户端是否连接至服务器。Gets a value that indicates whether the client is connected to the server. |
| IsRequestBeingRedirected |
获取一个值,该值指示客户端是否重定向至新位置。Gets a value that indicates whether the client is being redirected to a new location. |
| Output |
获取实现到传出的 HTTP 响应流的文本输出的对象。Gets the object that enables output of text to the outgoing HTTP response stream. |
| OutputStream |
向传出 HTTP 内容主体提供二进制输出。Provides binary output to the outgoing HTTP content body. |
| RedirectLocation |
获取或设置 HTTP |
| Status |
设置返回到客户端的 |
| StatusCode |
获取或设置返回到客户端的输出的 HTTP 状态代码。Gets or sets the HTTP status code of the output that is returned to the client. |
| StatusDescription |
获取或设置返回到客户端的输出的 HTTP 状态消息。Gets or sets the HTTP status message of the output that is returned to the client. |
| SubStatusCode |
获取或设置一个值,该值限定响应的状态代码。Gets or sets a value that qualifies the status code of the response. |
| SupportsAsyncFlush |
获取指示集合是否支持异步刷新操作的值。Gets a value that indicates whether the connection supports asynchronous flush operations. |
| SupportsAsyncFlush |
获取一个值,该值指示连接是否支持异步刷新操作。Gets a value that indicates whether the connection supports asynchronous flush operation. (继承自 HttpResponseBase) |
| SuppressContent |
获取或设置指示是否将 HTTP 内容发送到客户端的值。Gets or sets a value that indicates whether to send HTTP content to the client. |
| SuppressDefaultCacheControlHeader |
获取或设置一个值,该值指示是否取消默认缓存控件: 当前 HTTP 响应的专用标头。Gets or sets a value indicating whether to suppress the default Cache Control: private header for the current HTTP response. |
| SuppressDefaultCacheControlHeader |
获取或设置一个值,该值指示是否取消默认缓存控件:当前 HTTP 响应的专用 |
| SuppressFormsAuthenticationRedirect |
获取或设置指定重定向至登录页的 forms 身份验证是否应取消的值。Gets or sets a value that specifies whether forms authentication redirection to the login page should be suppressed. |
| SuppressFormsAuthenticationRedirect |
获取或设置指定重定向至登录页的 forms 身份验证是否应取消的值。Gets or sets a value that specifies whether forms authentication redirection to the login page should be suppressed. (继承自 HttpResponseBase) |
| TrySkipIisCustomErrors |
获取或设置一个值,该值指定是否禁用 IIS 7.0 自定义错误。Gets or sets a value that specifies whether IIS 7.0 custom errors are disabled. |
方法
| AddCacheDependency(CacheDependency[]) |
在派生类中替代时,将缓存依赖项与响应关联,这些依赖项使响应可以在进行缓存且指定依赖项更改的时候失效。When overridden in a derived class, associates cache dependencies with the response that enable the response to be invalidated if it is cached and if the specified dependencies change. |
| AddCacheItemDependencies(ArrayList) |
使缓存的响应的有效性依赖于缓存中的指定项。Makes the validity of a cached response dependent on the specified items in the cache. |
| AddCacheItemDependencies(String[]) |
使缓存的项的有效性依赖于缓存中的指定项。Makes the validity of a cached item dependent on the specified items in the cache. |
| AddCacheItemDependency(String) |
使缓存的响应的有效性依赖于缓存中的指定项。Makes the validity of a cached response dependent on the specified item in the cache. |
| AddFileDependencies(ArrayList) |
将文件名添加到当前响应所依赖的文件名的集合。Adds file names to the collection of file names on which the current response is dependent. |
| AddFileDependencies(String[]) |
将文件名数组添加到当前响应依赖的文件名集合中。Adds an array of file names to the collection of file names on which the current response is dependent. |
| AddFileDependency(String) |
将单个文件名添加到文件名集合中,当前响应依赖于该集合。Adds a single file name to the collection of file names on which the current response is dependent. |
| AddHeader(String, String) |
将 HTTP 标头添加到当前响应中。Adds an HTTP header to the current response. 提供此方法是为了与 ASP 的早期版本兼容。This method is provided for compatibility with earlier versions of ASP. |
| AddOnSendingHeaders(Action<HttpContextBase>) |
注册一个回调,在即将为此请求发送响应标头之前,ASP.NET 运行时将会调用此回调。Registers a callback that the ASP.NET runtime will invoke immediately before response headers are sent for this request. |
| AddOnSendingHeaders(Action<HttpContextBase>) |
注册一个回调,在即将为此请求发送响应标头之前,ASP.NET 运行时将会调用此回调。Registers a callback that the ASP.NET runtime will invoke immediately before response headers are sent for this request. (继承自 HttpResponseBase) |
| AppendCookie(HttpCookie) |
将 HTTP cookie 添加到 HTTP 响应 cookie 集合。Adds an HTTP cookie to the HTTP response cookie collection. |
| AppendHeader(String, String) |
将 HTTP 标头添加到当前响应中。Adds an HTTP header to the current response. |
| AppendToLog(String) |
将自定义日志信息添加到 Internet Information Services (IIS)日志文件。Adds custom log information to the Internet Information Services (IIS) log file. |
| ApplyAppPathModifier(String) |
如果会话正在使用 Cookieless 会话状态,则将会话 ID 添加到虚拟路径中,并返回组合路径。Adds a session ID to the virtual path if the session is using Cookieless session state, and returns the combined path. |
| BeginFlush(AsyncCallback, Object) |
向客户端发送当前所有缓冲的响应。Sends the currently buffered response to the client. |
| BeginFlush(AsyncCallback, Object) |
向客户端发送当前所有缓冲的响应。Sends the currently buffered response to the client. (继承自 HttpResponseBase) |
| BinaryWrite(Byte[]) |
将二进制字符串写入 HTTP 输出流。Writes a string of binary characters to the HTTP output stream. |
| Clear() |
清除当前响应中的所有标头和内容输出。Clears all headers and content output from the current response. |
| ClearContent() |
清除当前响应中的所有内容输出。Clears all content output from the current response. |
| ClearHeaders() |
清除当前响应中的所有标头。Clears all headers from the current response. |
| Close() |
关闭到客户端的套接字连接。Closes the socket connection to a client. |
| DisableKernelCache() |
禁用当前响应的内核缓存。Disables kernel caching for the current response. |
| DisableUserCache() |
禁用 IIS 用户-方式来缓存反映。Disables IIS user-mode caching for this response. |
| DisableUserCache() |
禁用 IIS 用户-方式来缓存反映。Disables IIS user-mode caching for this response. (继承自 HttpResponseBase) |
| End() |
将当前缓冲的所有输出发送到客户端,停止执行请求的进程,并引发 EndRequest 事件。Sends all currently buffered output to the client, stops execution of the requested process, and raises the EndRequest event. |
| EndFlush(IAsyncResult) |
完成异步刷新操作。Completes an asynchronous flush operation. |
| EndFlush(IAsyncResult) |
完成异步刷新操作。Completes an asynchronous flush operation. (继承自 HttpResponseBase) |
| Equals(Object) |
确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object. (继承自 Object) |
| Flush() |
向客户端发送当前所有缓冲的输出。Sends all currently buffered output to the client. |
| FlushAsync() |
向客户端异步发送当前缓冲的所有输出。Asynchronously sends all currently buffered output to the client. |
| FlushAsync() |
向客户端异步发送当前缓冲的所有输出。Asynchronously sends all currently buffered output to the client. (继承自 HttpResponseBase) |
| GetHashCode() |
作为默认哈希函数。Serves as the default hash function. (继承自 Object) |
| GetType() |
获取当前实例的 Type。Gets the Type of the current instance. (继承自 Object) |
| MemberwiseClone() |
创建当前 Object 的浅表副本。Creates a shallow copy of the current Object. (继承自 Object) |
| Pics(String) |
将 HTTP |
| PushPromise(String) |
支持将推送承诺发送到 HTTP 2.0 客户端的应用程序。Supports applications sending push promises to HTTP 2.0 clients. 有关详细信息,请参阅 HTTP/2 规范 8.2 节:服务器推送。For more information, see HTTP/2 Specification Section 8.2: Server Push. |
| PushPromise(String) |
支持将推送承诺发送到 HTTP 2.0 客户端的应用程序。Supports applications sending push promises to HTTP 2.0 clients. 有关详细信息,请参阅 HTTP/2 规范 8.2 节:服务器推送。For more information, see HTTP/2 Specification Section 8.2: Server Push. (继承自 HttpResponseBase) |
| PushPromise(String, String, NameValueCollection) |
支持将推送承诺发送到 HTTP 2.0 客户端的应用程序。Supports applications sending push promises to HTTP 2.0 clients. 有关详细信息,请参阅 HTTP/2 规范 8.2 节:服务器推送。For more information, see HTTP/2 Specification Section 8.2: Server Push. |
| PushPromise(String, String, NameValueCollection) |
支持将推送承诺发送到 HTTP 2.0 客户端的应用程序。Supports applications sending push promises to HTTP 2.0 clients. 有关详细信息,请参阅 HTTP/2 规范 8.2 节:服务器推送。For more information, see HTTP/2 Specification Section 8.2: Server Push. (继承自 HttpResponseBase) |
| Redirect(String) |
将请求重定向到指定的 URL。Redirects a request to the specified URL. |
| Redirect(String, Boolean) |
将请求重定向到指定的 URL,并指定是否应终止当前进程的执行。Redirects a request to the specified URL and specifies whether execution of the current process should terminate. |
| RedirectPermanent(String) |
执行从所请求 URL 到所指定 URL 的永久重定向。Performs a permanent redirect from the requested URL to the specified URL. |
| RedirectPermanent(String) |
执行从所请求 URL 到所指定 URL 的永久重定向。Performs a permanent redirect from the requested URL to the specified URL. (继承自 HttpResponseBase) |
| RedirectPermanent(String, Boolean) |
执行从所请求 URL 到所指定 URL 的永久重定向,并提供用于完成响应的选项。Performs a permanent redirect from the requested URL to the specified URL, and provides the option to complete the response. |
| RedirectPermanent(String, Boolean) |
执行从所请求 URL 到所指定 URL 的永久重定向,并提供用于完成响应的选项。Performs a permanent redirect from the requested URL to the specified URL, and provides the option to complete the response. (继承自 HttpResponseBase) |
| RedirectToRoute(Object) |
使用指定的路由参数值将请求重定向到新 URL。Redirects a request to a new URL by using the specified route parameter values. |
| RedirectToRoute(Object) |
使用路由参数值将请求重定向到新 URL。Redirects the request to a new URL by using route parameter values. (继承自 HttpResponseBase) |
| RedirectToRoute(RouteValueDictionary) |
使用指定的路由参数值将请求重定向到新 URL。Redirects a request to a new URL by using the specified route parameter values. |
| RedirectToRoute(RouteValueDictionary) |
使用路由参数值将请求重定向到新 URL。Redirects the request to a new URL by using route parameter values. (继承自 HttpResponseBase) |
| RedirectToRoute(String) |
使用指定的路由名称将请求重定向到新 URL。Redirects a request to a new URL by using the specified route name. |
| RedirectToRoute(String) |
使用路由名称将请求重定向到新 URL。Redirects the request to a new URL by using a route name. (继承自 HttpResponseBase) |
| RedirectToRoute(String, Object) |
使用指定路由名称和路由参数值将请求重定向到新 URL。Redirects a request to a new URL by using the specified route name and route parameter values. |
| RedirectToRoute(String, Object) |
使用路由参数值和路由名称将请求重定向到新 URL。Redirects the request to a new URL by using route parameter values and a route name. (继承自 HttpResponseBase) |
| RedirectToRoute(String, RouteValueDictionary) |
使用指定路由名称和路由参数值将请求重定向到新 URL。Redirects a request to a new URL by using the specified route name and route parameter values. |
| RedirectToRoute(String, RouteValueDictionary) |
使用路由参数值和路由名称将请求重定向到新 URL。Redirects the request to a new URL by using route parameter values and a route name. (继承自 HttpResponseBase) |
| RedirectToRoutePermanent(Object) |
使用指定的路由参数值执行从所请求 URL 到新 URL 的永久重定向。Performs a permanent redirection from a requested URL to a new URL by using the specified route parameter values. |
| RedirectToRoutePermanent(Object) |
使用路由参数值执行从所请求 URL 到新 URL 的永久重定向。Performs a permanent redirection from the requested URL to a new URL by using route parameter values. (继承自 HttpResponseBase) |
| RedirectToRoutePermanent(RouteValueDictionary) |
使用指定的路由参数值执行从所请求 URL 到新 URL 的永久重定向。Performs a permanent redirection from a requested URL to a new URL by using the specified route parameter values. |
| RedirectToRoutePermanent(RouteValueDictionary) |
使用路由参数值执行从所请求 URL 到新 URL 的永久重定向。Performs a permanent redirection from the requested URL to a new URL by using route parameter values. (继承自 HttpResponseBase) |
| RedirectToRoutePermanent(String) |
使用指定的路由名称执行从所请求 URL 到新 URL 的永久重定向。Performs a permanent redirection from a requested URL to a new URL by using the specified route name. |
| RedirectToRoutePermanent(String) |
使用路由名称执行从所请求 URL 到新 URL 的永久重定向。Performs a permanent redirection from the requested URL to a new URL by using a route name. (继承自 HttpResponseBase) |
| RedirectToRoutePermanent(String, Object) |
使用与新 URL 对应的路由名称和路由参数值执行从所请求 URL 到新 URL 的永久重定向。Performs a permanent redirection from a requested URL to a new URL by using a route name and route parameter values that correspond to the new URL. |
| RedirectToRoutePermanent(String, Object) |
使用路由参数值以及与新 URL 对应的路由的名称执行从所请求 URL 到新 URL 的永久重定向。Performs a permanent redirection from the requested URL to a new URL by using the route parameter values and the name of the route that correspond to the new URL. (继承自 HttpResponseBase) |
| RedirectToRoutePermanent(String, RouteValueDictionary) |
使用指定的路由名称和路由参数值执行从所请求 URL 到新 URL 的永久重定向。Performs a permanent redirection from a requested URL to a new URL by using the specified route name and route parameter values. |
| RedirectToRoutePermanent(String, RouteValueDictionary) |
使用路由参数值和路由名称执行从请求 URL 到新 URL 的永久重定向。Performs a permanent redirection from the requested URL to a new URL by using route parameter values and a route name. (继承自 HttpResponseBase) |
| RemoveOutputCacheItem(String) |
从缓存中移除与指定路径关联的所有缓存项。Removes from the cache all cached items that are associated with the specified path. |
| RemoveOutputCacheItem(String, String) |
使用指定的输出缓存提供程序删除与指定路径关联的所有输出缓存项。Uses the specified output-cache provider to remove all output-cache artifacts that are associated with the specified path. |
| RemoveOutputCacheItem(String, String) |
使用指定的输出缓存提供程序删除与指定路径关联的所有输出缓存项。Uses the specified output-cache provider to remove all output-cache artifacts that are associated with the specified path. (继承自 HttpResponseBase) |
| SetCookie(HttpCookie) |
更新 cookie 集合中的现有 cookie。Updates an existing cookie in the cookie collection. |
| ToString() |
返回表示当前对象的字符串。Returns a string that represents the current object. (继承自 Object) |
| TransmitFile(String) |
将指定文件写入 HTTP 响应输出流(不在内存中进行缓冲)。Writes the specified file to the HTTP response output stream, without buffering it in memory. |
| TransmitFile(String, Int64, Int64) |
将文件的指定部分写入 HTTP 响应输出流(不在内存中进行缓冲)。Writes the specified part of a file to the HTTP response output stream, without buffering it in memory. |
| Write(Char) |
将一个字符写入 HTTP 响应输出流。Writes a character to an HTTP response output stream. |
| Write(Char[], Int32, Int32) |
将指定字符数组写入 HTTP 响应输出流。Writes the specified array of characters to the HTTP response output stream. |
| Write(Object) |
将指定对象写入 HTTP 响应流。Writes the specified object to the HTTP response stream. |
| Write(String) |
将指定字符串写入 HTTP 响应输出流。Writes the specified string to the HTTP response output stream. |
| WriteFile(IntPtr, Int64, Int64) |
将指定文件写入 HTTP 响应输出流。Writes the specified file to the HTTP response output stream. |
| WriteFile(String) |
将指定文件的内容作为文件块写入 HTTP 响应输出流。Writes the contents of the specified file to the HTTP response output stream as a file block. |
| WriteFile(String, Boolean) |
将指定文件的内容写入 HTTP 响应输出流,并指定是否以内存块的形式写入内容。Writes the contents of the specified file to the HTTP response output stream and specifies whether the content is written as a memory block. |
| WriteFile(String, Int64, Int64) |
将指定文件写入 HTTP 响应输出流。Writes the specified file to the HTTP response output stream. |
| WriteSubstitution(HttpResponseSubstitutionCallback) |
将替换块插入到响应中,这样可以动态生成缓存的输出响应的区域。Inserts substitution blocks into the response, which enables dynamic generation of regions for cached output responses. |