HttpWebClientProtocol.UserAgent HttpWebClientProtocol.UserAgent HttpWebClientProtocol.UserAgent HttpWebClientProtocol.UserAgent Property

定義

それぞれの要求と共に送信されるユーザー エージェント ヘッダーの値を取得または設定します。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

プロパティ値

HTTP プロトコル ユーザー エージェント ヘッダーの値。The value of the HTTP protocol user agent header. 既定値は "MS Web Services Client Protocol number" です。number は、共通言語ランタイムのバージョンです (例 : 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).

// 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)

注釈

ユーザーエージェント文字列を使用すると、Web サーバーでクライアントを識別できます。The user agent string allows a Web server to identify the client.

適用対象

こちらもご覧ください