HttpRequest.UserAgent Proprietà

Definizione

Ottiene la stringa dell'agente utente non elaborata del browser client specificato. Si noti che può essere Null.

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

Valore della proprietà

String

Stringa dell'agente utente non elaborata del browser client.

Esempio

Nell'esempio di codice seguente viene assegnata l'identificazione del tipo del browser di richiesta a una variabile stringa.

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
   

Si applica a

Vedi anche