public void connectBCP(string thisBrowser, string thisURL, List<Host> thisHosts) { try { //Console.WriteLine(thisHosts.Find(h => h.status == "Active").ip + thisURL); Host thisHost = new Host(); thisHost = thisHosts.Find(h => h.status == "Active"); this.SetText("Connecting host: " + thisHost.host_name); System.Diagnostics.Process.Start(thisBrowser, "http://" + thisHost.host_name + thisURL); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
//Get server host object. public void queryPrimaryHost(List<Host> thishostlist) { primary = thishostlist.FirstOrDefault(o => o.host_name == "primary"); }
//add new host into xml file. public void addXML(string host_name, string location, string id, string ip, string status) { Host thishost = new Host() { id = id, host_name = host_name, location = location, ip = ip, status = status }; hostlist.Add(thishost); saveXML(hostlist, sDataPath); loadXML(sDataPath); }