HttpContextExtensions.GetIISServerVariable(HttpContext, String) 方法

定义

注意

This is obsolete and will be removed in a future version. Use GetServerVariable instead.

获取当前请求的服务器变量的值。

public:
[System::Runtime::CompilerServices::Extension]
 static System::String ^ GetIISServerVariable(Microsoft::AspNetCore::Http::HttpContext ^ context, System::String ^ variableName);
public static string GetIISServerVariable (this Microsoft.AspNetCore.Http.HttpContext context, string variableName);
[System.Obsolete("This is obsolete and will be removed in a future version. Use GetServerVariable instead.")]
public static string GetIISServerVariable (this Microsoft.AspNetCore.Http.HttpContext context, string variableName);
[System.Obsolete("This is obsolete and will be removed in a future version. Use GetServerVariable instead.")]
public static string? GetIISServerVariable (this Microsoft.AspNetCore.Http.HttpContext context, string variableName);
static member GetIISServerVariable : Microsoft.AspNetCore.Http.HttpContext * string -> string
[<System.Obsolete("This is obsolete and will be removed in a future version. Use GetServerVariable instead.")>]
static member GetIISServerVariable : Microsoft.AspNetCore.Http.HttpContext * string -> string
<Extension()>
Public Function GetIISServerVariable (context As HttpContext, variableName As String) As String

参数

context
HttpContext

请求的 http 上下文。

variableName
String

变量的名称。

返回

null 如果服务器不支持该功能,则 IServerVariablesFeature 为 。 如果变量不存在或未设置,则可能会返回 null 或空。

属性

注解

有关 IIS 中可用的常见服务器变量的列表,请参阅 http://go.microsoft.com/fwlink/?LinkId=52471

适用于