ClientTarget.UserAgent Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the user agent's identification name.
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
Property Value
The user agent's identification name.
- Attributes
Examples
The following code example shows how to get the UserAgent from the configuration file of an existing Web application.
// 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)
Remarks
The UserAgent property refers to the userAgent
attribute of the add
element in the clientTarget
section of the configuration file.
The ASP.NET configuration defaults allow customizing pages for various Microsoft Internet Explorer versions. Among them you find the alias uplevel
, which tells ASP.NET to send the client HTML and ECMAScript supported by Internet Explorer 4.0 and later, and downlevel
, which tells ASP.NET to limit the HTML and script to that supported by earlier browsers than Internet Explorer 4.0.
Applies to
See also
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기