public static void LoadConfig() { if (dirty) { try { adminHardwareId = AdminUtil.GetHardwareId(); XmlDocument doc = new XmlDocument(); doc.Load("Config.xml"); urpUsername = doc.SelectSingleNode("//Config/ScoreQuery/@urpUsername").InnerText; urpPassword = RC2Util.Decrypt("hackerzhou", doc.SelectSingleNode("//Config/ScoreQuery/@urpPassword").InnerText); isSavePassword = bool.Parse(doc.SelectSingleNode("//Config/ScoreQuery/@isSavePassword").InnerText); useAutoRefresh = bool.Parse(doc.SelectSingleNode("//Config/ScoreQuery/@useAutoRefresh").InnerText); useProxy = bool.Parse(doc.SelectSingleNode("//Config/Proxy/@useProxy").InnerText); proxyHost = doc.SelectSingleNode("//Config/Proxy/@proxyHost").InnerText; proxyPort = int.Parse(doc.SelectSingleNode("//Config/Proxy/@proxyPort").InnerText); proxyUseAuth = bool.Parse(doc.SelectSingleNode("//Config/Proxy/@proxyUseAuth").InnerText); proxyUsername = doc.SelectSingleNode("//Config/Proxy/@proxyUsername").InnerText; proxyPassword = doc.SelectSingleNode("//Config/Proxy/@proxyPassword").InnerText; adminHardwareKey = doc.SelectSingleNode("//Config/Admin/@adminHardwareKey").InnerText; adminUsername = doc.SelectSingleNode("//Config/Admin/@adminUsername").InnerText; adminPassword = doc.SelectSingleNode("//Config/Admin/@adminPassword").InnerText; styleIndex = int.Parse(doc.SelectSingleNode("//Config/Style/@styleIndex").InnerText); isAdmin = AdminUtil.IsAdmin(adminHardwareKey); } catch { WriteConfig(); } dirty = false; } }
public static String getPassword() { return(RC2Util.Decrypt("hackerzhou", ReadConfig("Login", "Password", ""))); }