HttpRequest.UserAgent 속성

정의

제공된 클라이언트 브라우저의 원시 사용자 문자열을 가져옵니다. null일 수도 있다고 적어두세요.

public:
 property System::String ^ UserAgent { System::String ^ get(); };
public string UserAgent { get; }
member this.UserAgent : string
Public ReadOnly Property UserAgent As String

속성 값

String

클라이언트 브라우저의 원시 사용자 에이전트 문자열입니다.

예제

다음 코드 예제에서는 요청 브라우저의 형식 식별을 문자열 변수에 할당합니다.

String userAgent;
userAgent = Request.UserAgent;
if (userAgent.IndexOf("MSIE 6.0") > -1)
{
   // The browser is Microsoft Internet Explorer Version 6.0.
}

Dim userAgent As String
 userAgent= Request.UserAgent
 If userAgent.IndexOf("MSIE 6.0") > -1 Then
    ' The browser is Microsoft Internet Explorer 6.0.
 End If
   

적용 대상

추가 정보