次の方法で共有


ClientTarget.UserAgent プロパティ

定義

ユーザー エージェントの識別名を取得します。

public:
 property System::String ^ UserAgent { System::String ^ get(); };
[System.Configuration.ConfigurationProperty("userAgent", IsRequired=true)]
[System.Configuration.StringValidator(MinLength=1)]
public string UserAgent { get; }
[<System.Configuration.ConfigurationProperty("userAgent", IsRequired=true)>]
[<System.Configuration.StringValidator(MinLength=1)>]
member this.UserAgent : string
Public ReadOnly Property UserAgent As String

プロパティ値

String

ユーザー エージェントの識別名。

属性

次のコード例は、既存の Web アプリケーションの UserAgent 構成ファイルから取得する方法を示しています。


           // Get the first client target 
           // in the collection.
           clientTarget = clientTargets[0];

           // Get he user agent.
           userAgent = clientTarget.UserAgent;

           msg = String.Format(
                 "User Agent: {0}\n",
                 userAgent);
' Get the first client target 
' in the collection.
clientTarget = clientTargets(0)

' Get he user agent.
userAgent = clientTarget.UserAgent

msg = String.Format( _
"User Agent: {0}" + ControlChars.Lf, userAgent)

注釈

このプロパティは UserAgentuserAgent 構成ファイルの add セクション内の clientTarget 要素の属性を参照します。

ASP.NET 構成の既定値では、さまざまな Microsoft Internet Explorer バージョンのページをカスタマイズできます。 その中で、Internet Explorer 4.0 以降でサポートされているクライアント HTML と ECMAScript を送信するように ASP.NET に指示するエイリアスuplevelが見つかります。このエイリアスは、downlevelhtml とスクリプトを Internet Explorer 4.0 よりも前のブラウザーでサポートされているブラウザーに制限するように ASP.NET に指示します。

適用対象

こちらもご覧ください