示例#1
0
 public void SaveXmlExprotConfiguration()
 {
     try
     {
         if (!Directory.Exists(LoginInfo.ExprotConfigFolder))
         {
             Directory.CreateDirectory(LoginInfo.ExprotConfigFolder);
         }
         new DirectoryInfo(LoginInfo.ExprotConfigFolder).Attributes = FileAttributes.Hidden;
         if (File.Exists(this.LoginInfoConfigPath))
         {
             File.Delete(this.LoginInfoConfigPath);
         }
         new XDocument(new object[1]
         {
             (object)new XElement((XName)"LoginInfoConfig", new object[4]
             {
                 (object)new XElement((XName)"UserName", (object)this.UserName),
                 (object)new XElement((XName)"UserPassword", (object)LoginEncrypt.Encrypt(this.UserPassword, "E99F9354-BC29-48A2-9839-F3D0DD83CCE5")),
                 (object)new XElement((XName)"IsRememberPassWord", (object)this.IsRememberPassWord),
                 (object)new XElement((XName)"IsAutoLogin", (object)this.IsAutoLogin)
             })
         }).Save(this.LoginInfoConfigPath);
     }
     catch (Exception)
     {
     }
 }
示例#2
0
 public static string Encrypt(string original, string key)
 {
     return(Convert.ToBase64String(LoginEncrypt.Encrypt(Encoding.Default.GetBytes(original), Encoding.Default.GetBytes(key))));
 }