Exemplo n.º 1
0
 public static byte[] EncryptPass(string pass)
 {
     try
     {
         CryptoDES objCryptoDES = new CryptoDES();
         objCryptoDES.Initialize();
         string encryptSTR = objCryptoDES.DESSelfEncrypt(pass);
         byte[] contents   = StrToByteArray(encryptSTR);
         return(contents);
     }
     catch (Exception oEx)
     {
         LoggingHelper.ShowMessage(oEx);
         return(null);
     }
 }
Exemplo n.º 2
0
        public void SetCookies(string content)
        {
#if DEBUG
            if (!Directory.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + Path.DirectorySeparatorChar + "db4objects" + Path.DirectorySeparatorChar + "ObjectManagerEnterprise"))
            {
                //Directory.CreateDirectory(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + Path.DirectorySeparatorChar + "db4objects");
                Directory.CreateDirectory(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + Path.DirectorySeparatorChar + "db4objects" + Path.DirectorySeparatorChar + "ObjectManagerEnterprise");
            }
#endif
            string     filepath   = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + Path.DirectorySeparatorChar + "db4objects" + Path.DirectorySeparatorChar + "ObjectManagerEnterprise" + Path.DirectorySeparatorChar + "encyr.info";
            FileStream fs         = new FileStream(filepath, FileMode.Create, FileAccess.Write);
            string     encryptSTR = objCryptoDES.DESSelfEncrypt(content);
            byte[]     contents   = StrToByteArray(encryptSTR);
            fs.Write(contents, 0, contents.Length);
            fs.Close();
        }
Exemplo n.º 3
0
		public static byte[] EncryptPass(string pass)
		{
			try
			{
				CryptoDES objCryptoDES = new CryptoDES();
				objCryptoDES.Initialize();
				string encryptSTR = objCryptoDES.DESSelfEncrypt(pass);
				byte[] contents = StrToByteArray(encryptSTR);
				return contents;
			}
			catch (Exception oEx)
			{
				LoggingHelper.ShowMessage(oEx);
				return null;
			}

		}