HttpRequest.UserAgent Propriedade
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Obtém a string bruta de agente de utilizador do navegador cliente que foi fornecida. Por favor, note que pode ser nulo.
public:
property System::String ^ UserAgent { System::String ^ get(); };
public string UserAgent { get; }
member this.UserAgent : string
Public ReadOnly Property UserAgent As String
Valor de Propriedade
A string bruta de agente de utilizador do navegador cliente.
Exemplos
O exemplo de código seguinte atribui a identificação de tipo do navegador requerente a uma variável de 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