HttpWebRequest.UserAgent Property

Gets or sets the value of the User-agent HTTP header.

Namespace:  System.Net
Assembly:  System.Net (in System.Net.dll)

'Declaration
Public Property UserAgent As String

Property Value

Type: System.String
The value of the User-agent HTTP header. The default value is Nothing.
NoteNote:

The value for this property is stored in WebHeaderCollection. If WebHeaderCollection is set, the property value is lost.

Version Notes

Silverlight for the desktop

Do not use this member when targeting Silverlight 4.

Silverlight for Windows Phone Silverlight for Windows Phone

You can use this member when targeting Silverlight for Windows Phone to specify the User-agent string. For more information see Header Support.

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

Show: