Beispiel #1
0
 public static bool docFileDB(string pad)
 {
     if (File.Exists(pad))
     {
         StreamReader stw = null;
         try
         {
             stw                       = new StreamReader(pad);
             MaHoaString.key           = "z3r0.IT";
             ThamSoKetNoi.ServerName   = MaHoaString.Decrypt(stw.ReadLine());
             ThamSoKetNoi.DatabaseName = MaHoaString.Decrypt(stw.ReadLine());
             ThamSoKetNoi.UserName     = MaHoaString.Decrypt(stw.ReadLine());
             ThamSoKetNoi.PassWord     = MaHoaString.Decrypt(stw.ReadLine());
             stw.Close();
             stw.Dispose();
             return(true);
         }
         catch
         {
             stw.Dispose();
             return(false);
         }
     }
     return(false);
 }
Beispiel #2
0
        public static TaiKhoan docFileLG(string pad)
        {
            TaiKhoan ac = new TaiKhoan();;

            if (File.Exists(pad))
            {
                StreamReader stw = null;
                try
                {
                    stw             = new StreamReader(pad);
                    MaHoaString.key = "HuyenTrang";
                    ac = new TaiKhoan(MaHoaString.Decrypt(stw.ReadLine()),
                                      MaHoaString.Decrypt(stw.ReadLine()));
                    stw.Close();
                    stw.Dispose();
                    return(ac);
                }
                catch
                {
                    stw.Dispose();
                    return(null);
                }
            }
            return(ac);
        }
Beispiel #3
0
        public static void ghifileLG(string pad, string uName, string pass)
        {
            MaHoaString.key = "HuyenTrang";
            StreamWriter stw = new StreamWriter(pad);

            stw.WriteLine("{0}", MaHoaString.Encrypt(uName));
            stw.WriteLine("{0}", MaHoaString.Encrypt(pass));
            stw.Close();
        }
Beispiel #4
0
        public static void ghifileDB(string pad, string Host, string Db, string uName, string pass)
        {
            MaHoaString.key = "z3r0.IT";
            StreamWriter stw = new StreamWriter(pad);

            stw.WriteLine("{0}", MaHoaString.Encrypt(Host));
            stw.WriteLine("{0}", MaHoaString.Encrypt(Db));
            stw.WriteLine("{0}", MaHoaString.Encrypt(uName));
            stw.WriteLine("{0}", MaHoaString.Encrypt(pass));
            stw.Close();
        }
Beispiel #5
0
 public static Account docFileLG(string pad)
 {
     if (File.Exists(pad))
     {
         StreamReader stw = null;
         try
         {
             stw             = new StreamReader(pad);
             MaHoaString.key = "HuyenTrang";
             Account ac = new Account(MaHoaString.Decrypt(stw.ReadLine()),
                                      MaHoaString.Decrypt(stw.ReadLine()));
             stw.Close();
             stw.Dispose();
             return(ac);
         }
         catch
         {
             stw.Dispose();
             return(null);
         }
     }
     return(null);
 }