共用方式為


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

屬性值

使用者代理的識別名稱。

屬性

範例

以下程式碼範例展示了如何從現有網頁應用程式的設定檔取得 。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)

備註

UserAgent屬性指userAgent的是設定檔區段中元素的addclientTarget屬性。

ASP.NET 設定預設允許為不同 Microsoft Internet Explorer 版本自訂頁面。 其中有別名 uplevel,指示 ASP.NET 傳送 Internet Explorer 4.0 及以後版本支援的客戶端 HTML 和 ECMAScript,以及 downlevel,指示 ASP.NET 限制 HTML 和腳本,僅限於 Internet Explorer 4.0 之前的瀏覽器所支援的版本。

適用於

另請參閱