using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml; namespace CollectInformation.Tools { public static class constants { public static string urlbase = "http://broadcast.kqyjy.com"; public static string host = urlbase + "/api/"; public static string filehost = urlbase + "/files/{0}/{1}_{2}_{3}/upload"; public static string fetch = "usual/{0}/fetch"; public static string update = "usual/{0}/update"; public static string install = "usual/{0}"; public static string tempFiles = "tempFiles\\"; public static string userToken = null; public static string loginName = ""; public static string loginpwd = ""; public static string saveName = "0"; public static string savePwd = "0"; public static void init(string path) { try { XmlDocument xdoc = new XmlDocument(); xdoc.Load(path + "\\config.xml"); XmlNode configNode = xdoc.FirstChild; constants.urlbase = configNode.SelectSingleNode("urlbase").InnerText; constants.host = constants.urlbase + "/api/"; constants.filehost = constants.urlbase + "/files/{0}/{1}_{2}_{3}/upload"; constants.loginName = configNode.SelectSingleNode("loginName").InnerText; constants.loginpwd = configNode.SelectSingleNode("password").InnerText; constants.saveName = configNode.SelectSingleNode("saveName").InnerText; constants.savePwd = configNode.SelectSingleNode("savePwd").InnerText; } catch (Exception e) { } } } }