HttpContextServerVariableExtensions.GetServerVariable Metodo

Definizione

Ottiene il valore di una variabile server per la richiesta corrente.

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

Parametri

context
HttpContext

Contesto HTTP per la richiesta.

variableName
String

Nome della variabile.

Restituisce

null se il server non supporta la IServerVariablesFeature funzionalità. Può restituire null o vuoto se la variabile non esiste o non è impostata.

Si applica a