HttpContextServerVariableExtensions.GetServerVariable Yöntem

Tanım

Geçerli istek için bir sunucu değişkeninin değerini alır.

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

Parametreler

context
HttpContext

İsteğin http bağlamı.

variableName
String

Değişkenin adı.

Döndürülenler

null sunucu özelliği desteklemiyorsa IServerVariablesFeature . Değişken yoksa veya ayarlanmadıysa null veya boş döndürebilir.

Şunlara uygulanır