HttpContextServerVariableExtensions.GetServerVariable 方法       
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取当前请求的服务器变量的值。
public:
[System::Runtime::CompilerServices::Extension]
 static System::String ^ GetServerVariable(Microsoft::AspNetCore::Http::HttpContext ^ context, System::String ^ variableName);
	public static string? GetServerVariable(this Microsoft.AspNetCore.Http.HttpContext context, string variableName);
	public static string GetServerVariable(this Microsoft.AspNetCore.Http.HttpContext context, string variableName);
	static member GetServerVariable : Microsoft.AspNetCore.Http.HttpContext * string -> string
	<Extension()>
Public Function GetServerVariable (context As HttpContext, variableName As String) As String
	参数
- context
 - HttpContext
 
请求的 http 上下文。
- variableName
 - String
 
变量的名称。
返回
              null 如果服务器不支持该功能,则 IServerVariablesFeature 为 。
如果变量不存在或未设置,则可能会返回 null 或空。