ClientTarget.UserAgent Vlastnost
Definice
Důležité
Některé informace platí pro předběžně vydaný produkt, který se může zásadně změnit, než ho výrobce nebo autor vydá. Microsoft neposkytuje žádné záruky, výslovné ani předpokládané, týkající se zde uváděných informací.
Získá identifikační jméno uživatelského agenta.
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
Hodnota vlastnosti
Identifikační jméno uživatelského agenta.
- Atributy
Příklady
Následující příklad kódu ukazuje, jak získat UserAgent z konfiguračního souboru existující webové aplikace.
// 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)
Poznámky
Vlastnost UserAgent odkazuje na userAgent
atribut add
prvku v clientTarget
oddílu konfiguračního souboru.
Výchozí nastavení konfigurace ASP.NET umožňuje přizpůsobení stránek pro různé verze aplikace Microsoft Internet Explorer. Mezi nimi najdete aliasuplevel
, který informuje ASP.NET, že má odeslat klientský kód HTML a ECMAScript podporovaný aplikací Internet Explorer 4.0 a novější, a downlevel
, který informuje ASP.NET omezit html a skript na to, které podporuje dřívější prohlížeče než Internet Explorer 4.0.