Beispiel #1
0
 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;
     }
 }
Beispiel #2
0
 public static String getPassword()
 {
     return(RC2Util.Decrypt("hackerzhou", ReadConfig("Login", "Password", "")));
 }
Beispiel #3
0
 public static void updateLogin(String username, String password, bool isSavePassword)
 {
     WriteConfig("Login", "Username", username);
     WriteConfig("Login", "Password", RC2Util.Encrypt("hackerzhou", password));
     WriteConfig("Login", "IsSavePassword", isSavePassword.ToString());
 }