예제 #1
0
파일: file.cs 프로젝트: seakBz/CShap
 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);
 }
예제 #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);
        }
예제 #3
0
파일: file.cs 프로젝트: seakBz/CShap
        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();
        }
예제 #4
0
파일: file.cs 프로젝트: seakBz/CShap
        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();
        }
예제 #5
0
파일: file.cs 프로젝트: seakBz/CShap
 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);
 }