Back to Devexpress

MapWebRequestEventArgs.UserAgent Property

windowsforms-devexpress-dot-xtramap-dot-mapwebrequesteventargs.md

latest3.8 KB
Original Source

MapWebRequestEventArgs.UserAgent Property

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

Namespace : DevExpress.XtraMap

Assembly : DevExpress.XtraMap.v25.2.dll

NuGet Package : DevExpress.Win.Map

Declaration

csharp
public string UserAgent { get; set; }
vb
Public Property UserAgent As String

Property Value

TypeDescription
String

A String value of the user-agent HTTP header.

|

The following code snippets (auto-collected from DevExpress Examples) contain references to the UserAgent property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-map-connect-to-openstreetmap/CS/ConnectToOpenStreet/Form1.cs#L38

csharp
private void OnWebRequest(object sender, MapWebRequestEventArgs e) {
    e.UserAgent = "Sample app with OSM tiles";
    e.Referer = "https://www.mycompanysite.com/";

winforms-map-create-different-map-shapes/CS/MapItemsExample/Form1.cs#L112

csharp
private void openStreetMapDataProvider1_WebRequest(object sender, MapWebRequestEventArgs e) {
    e.UserAgent = "Sample OSM map example";
    e.Referer = "https://www.mycompanysite.com/";

winforms-map-use-openstreetmap-search-service/CS/OsmSearchSample/MainForm.cs#L30

csharp
private void DataProvider_WebRequest(object sender, MapWebRequestEventArgs e) {
    e.UserAgent = "Sample app with OSM tiles and search";
    e.Referer = "https://www.mycompanysite.com/";

winforms-map-connect-to-openstreetmap/VB/ConnectToOpenStreet/Form1.vb#L35

vb
Private Sub OnWebRequest(ByVal sender As Object, ByVal e As MapWebRequestEventArgs)
    e.UserAgent = "Sample app with OSM tiles"
    e.Referer = "https://www.mycompanysite.com/"

winforms-map-create-different-map-shapes/VB/MapItemsExample/Form1.vb#L90

vb
Private Sub openStreetMapDataProvider1_WebRequest(ByVal sender As Object, ByVal e As MapWebRequestEventArgs)
    e.UserAgent = "Sample OSM map example"
    e.Referer = "https://www.mycompanysite.com/"

See Also

MapWebRequestEventArgs Class

MapWebRequestEventArgs Members

DevExpress.XtraMap Namespace