Share via


HttpContextExtensions.GetIISServerVariable(HttpContext, String) Metode

Definisi

Perhatian

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

Mendapatkan nilai variabel server untuk permintaan saat ini.

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

Parameter

context
HttpContext

Konteks http untuk permintaan.

variableName
String

Nama variabel.

Mengembalikan

null jika server tidak mendukung fitur tersebut IServerVariablesFeature . Dapat mengembalikan null atau kosong jika variabel tidak ada atau tidak diatur.

Atribut

Keterangan

Untuk daftar variabel server umum yang tersedia di IIS, lihat http://go.microsoft.com/fwlink/?LinkId=52471.

Berlaku untuk