HttpContextServerVariableExtensions.GetServerVariable 메서드

정의

현재 요청에 대한 서버 변수의 값을 가져옵니다.

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 또는 empty를 반환할 수 있습니다.

적용 대상