共用方式為


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

適用於