|
Este artículo proviene de un motor de traducción automática. Mueva el puntero sobre las frases del artículo para ver el texto original. Más información.
|
Traducción
Original
|
HttpContext (Clase)
Espacio de nombres: System.Web
Ensamblado: System.Web (en System.Web.dll)
El tipo HttpContext expone los siguientes miembros.
| Nombre | Descripción | |
|---|---|---|
![]() | HttpContext(HttpWorkerRequest) | |
![]() | HttpContext(HttpRequest, HttpResponse) |
| Nombre | Descripción | |
|---|---|---|
![]() | AllErrors | |
![]() | AllowAsyncDuringSyncStages | |
![]() | Application | |
![]() | ApplicationInstance | |
![]() | AsyncPreloadMode | |
![]() | Cache | |
![]() ![]() | Current | |
![]() | CurrentHandler | |
![]() | CurrentNotification | |
![]() | Error | |
![]() | Handler | |
![]() | IsCustomErrorEnabled | |
![]() | IsDebuggingEnabled | |
![]() | IsPostNotification | |
![]() | IsWebSocketRequest | |
![]() | IsWebSocketRequestUpgrading | |
![]() | Items | |
![]() | PageInstrumentation | |
![]() | PreviousHandler | |
![]() | Profile | |
![]() | Request | |
![]() | Response | |
![]() | Server | |
![]() | Session | |
![]() | SkipAuthorization | |
![]() | ThreadAbortOnTimeout | |
![]() | Timestamp | |
![]() | Trace | |
![]() | User | |
![]() | WebSocketNegotiatedProtocol | |
![]() | WebSocketRequestedProtocols |
| Nombre | Descripción | |
|---|---|---|
![]() | AcceptWebSocketRequest(Func<AspNetWebSocketContext, Task>) | |
![]() | AcceptWebSocketRequest(Func<AspNetWebSocketContext, Task>, AspNetWebSocketOptions) | |
![]() | AddError | |
![]() | AddOnRequestCompleted | |
![]() | ClearError | |
![]() | DisposeOnPipelineCompleted | |
![]() | Equals(Object) | |
![]() ![]() | GetAppConfig | Obsoleto. |
![]() | GetConfig | Obsoleto. |
![]() ![]() | GetGlobalResourceObject(String, String) | |
![]() ![]() | GetGlobalResourceObject(String, String, CultureInfo) | |
![]() | GetHashCode | |
![]() ![]() | GetLocalResourceObject(String, String) | |
![]() ![]() | GetLocalResourceObject(String, String, CultureInfo) | |
![]() | GetSection | |
![]() | GetType | |
![]() | RemapHandler | |
![]() | RewritePath(String) | |
![]() | RewritePath(String, Boolean) | |
![]() | RewritePath(String, String, String) | |
![]() | RewritePath(String, String, String, Boolean) | |
![]() | SetSessionStateBehavior | |
![]() | ToString |
| Nombre | Descripción | |
|---|---|---|
![]() ![]() | IServiceProvider.GetService | Infraestructura. |
<%@ Page Language="C#" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> protected void Page_Load(object sender, EventArgs e) { // The HttpContext associated with the page can be accessed by the Context property. System.Text.StringBuilder sb = new System.Text.StringBuilder(); // Use the current HttpContext object to determine if custom errors are enabled. sb.Append("Is custom errors enabled: " + Context.IsCustomErrorEnabled.ToString() + "<br/>"); // Use the current HttpContext object to determine if debugging is enabled. sb.Append("Is debugging enabled: " + Context.IsDebuggingEnabled.ToString() + "<br/>"); // Use the current HttpContext object to access the current TraceContext object. sb.Append("Trace Enabled: " + Context.Trace.IsEnabled.ToString() + "<br/>"); // Use the current HttpContext object to access the current HttpApplicationState object. sb.Append("Number of items in Application state: " + Context.Application.Count.ToString() + "<br/>"); // Use the current HttpContext object to access the current HttpSessionState object. // Session state may not be configured. try { sb.Append("Number of items in Session state: " + Context.Session.Count.ToString() + "<br/>"); } catch { sb.Append("Session state not enabled. <br/>"); } // Use the current HttpContext object to access the current Cache object. sb.Append("Number of items in the cache: " + Context.Cache.Count.ToString() + "<br/>"); // Use the current HttpContext object to determine the timestamp for the current HTTP Request. sb.Append("Timestamp for the HTTP request: " + Context.Timestamp.ToString() + "<br/>"); // Assign StringBuilder object to output label. OutputLabel.Text = sb.ToString(); } </script> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>HttpContext Example</title> </head> <body> <form id="form1" runat="server"> <div> Using the current HttpContext to get information about the current page. <br /> <asp:Label id="OutputLabel" runat="server"></asp:Label> </div> </form> </body> </html>
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (no se admite el rol Server Core), Windows Server 2008 R2 (se admite el rol Server Core con SP1 o versiones posteriores; no se admite Itanium)
.NET Framework no admite todas las versiones de todas las plataformas. Para obtener una lista de las versiones compatibles, vea Requisitos de sistema de .NET Framework.
