<serverItem url="http://net931/ArcGIS/rest/services" matchAll="true" domain="net931" username="rex" password="rex" />
#if !SILVERLIGHT private System.Net.ICredentials credentials; /// <summary> /// Gets or sets the network credentials that are sent to the host and used to authenticate the request. /// </summary> /// <value>The credentials used for authentication.</value> public System.Net.ICredentials Credentials { get { return credentials; } set { if (credentials != value) { credentials = value; OnPropertyChanged("Credentials"); } } } #endif
<esri:WmsLayer ID="AGSWMSLayer" Credentials="{StaticResource MyCredentials}" Url="http://secured/MapServer/WMSServer" Initialized="WmsLayer_Initialized"/>
private void LayerWithCredentials(ESRI.ArcGIS.Client.Toolkit.DataSources.WmsLayer layer) { WebClient wmsRequest= new WebClient(); wmsRequest.DownloadStringCompleted += (sender, args) => { map.Layers.Insert(0, layer); }; ICredentials creds = new NetworkCredential("username", "password"); wmsRequest.Credentials = creds; wmsRequest.UseDefaultCredentials = true; wmsRequest.DownloadStringAsync(new Uri(layer.Url)); }
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.