HttpRequest.UserAgent Proprietà

Definizione

Ottiene la stringa dell'agente utente non elaborato del browser client fornito. Si noti che potrebbe 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à

Stringa dell'agente utente non elaborato del browser client.

Esempio

Nell'esempio di codice seguente viene assegnata l'identificazione del tipo del browser richiedente 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