public override void Refresh() { base.Refresh(); try { string server = ConfigTextStream.ExtractValue(_connectionString, "server"); //string usr = ConfigTextStream.ExtractValue(_connectionString, "user"); //string pwd = ConfigTextStream.ExtractValue(_connectionString, "pwd"); //if (usr != "" || pwd != "") //{ // connector.setAuthentification(usr, pwd); //} foreach (ServiceDescription service in ArcServerHelper.MapServerServices(server, ProxySettings.Proxy("http://" + server))) { base.AddChildObject( new AGSServiceExplorerObject(this, service.Name, "server=" + server + ";service=" + service.Url)); } } catch (Exception ex) { System.Windows.Forms.MessageBox.Show(ex.Message); } }
private void btnConnect_Click(object sender, EventArgs e) { try { Cursor = Cursors.WaitCursor; lstServices.Items.Clear(); foreach (ServiceDescription sd in ArcServerHelper.MapServerServices(txtServer.Text, ProxySettings.Proxy("http://" + txtServer.Text))) { lstServices.Items.Add(new ServiceDescriptionItem(sd)); } } catch (Exception ex) { Cursor = Cursors.Default; MessageBox.Show(ex.Message); } finally { Cursor = Cursors.Default; } }