HttpRequest.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 raw user agent string of the client browser that has been provided. Please note it may be null.
public:
property System::String ^ UserAgent { System::String ^ get(); };
public string UserAgent { get; }
member this.UserAgent : string
Public ReadOnly Property UserAgent As String
Property Value
The raw user agent string of the client browser.
Examples
The following code example assigns the type identification of the requesting browser to a string variable.
String userAgent;
userAgent = Request.UserAgent;
if (userAgent.IndexOf("MSIE 6.0") > -1)
{
// The browser is Microsoft Internet Explorer Version 6.0.
}
Dim userAgent As String
userAgent= Request.UserAgent
If userAgent.IndexOf("MSIE 6.0") > -1 Then
' The browser is Microsoft Internet Explorer 6.0.
End If
Applies to
See also
שתף איתנו פעולה ב- GitHub
ניתן למצוא את המקור לתוכן זה ב- GitHub, שם ניתן גם ליצור ולסקור בעיות ולמשוך בקשות. לקבלת מידע נוסף, עיין במדריך התורמים שלנו.