HttpWebClientProtocol.UserAgent Proprietà

Definizione

Ottiene o imposta il valore dell'intestazione dell'agente utente inviata con ogni richiesta.Gets or sets the value for the user agent header that is sent with each request.

public:
 property System::String ^ UserAgent { System::String ^ get(); void set(System::String ^ value); };
[System.ComponentModel.Browsable(false)]
public string UserAgent { get; set; }
member this.UserAgent : string with get, set
Public Property UserAgent As String

Valore della proprietà

Valore dell'intestazione agente utente del protocollo HTTP.The value of the HTTP protocol user agent header. L'impostazione predefinita è "MS Web Services Client Protocol number", dove number corrisponde alla versione del Common Language Runtime (ad esempio, 1.0.3705.0).The default is "MS Web Services Client Protocol number ", where number is the version of the common language runtime (for example, 1.0.3705.0).

Attributi

Esempi

// MyMath is a proxy class.
test::MyMath^ objMyMath = gcnew test::MyMath;

// Get the default user agent.
Console::WriteLine( "Default user agent is: {0}", objMyMath->UserAgent );
objMyMath->UserAgent = "My Agent";
Console::WriteLine( "Modified user agent is: {0}", objMyMath->UserAgent );
// MyMath is a proxy class.
MyMath objMyMath = new MyMath();

// Get the default user agent.
Console.WriteLine("Default user agent is: " + objMyMath.UserAgent);
objMyMath.UserAgent = "My Agent";
Console.WriteLine("Modified user agent is: " + objMyMath.UserAgent);
' MyMath is a proxy class.
Dim objMyMath As MyMath = new MyMath()

' Get the default user agent.
Console.WriteLine("Default user agent is: " & objMyMath.UserAgent)
objMyMath.UserAgent = "My Agent"
Console.WriteLine("Modified user agent is: " & objMyMath.UserAgent)

Commenti

La stringa agente utente consente a un server Web di identificare il client.The user agent string allows a Web server to identify the client.

Si applica a

Vedi anche