コード例 #1
0
ファイル: frmCauHinh.cs プロジェクト: tayeumi/HFC
        private void btnCapNhat_Click(object sender, EventArgs e)
        {
            Class.RegistryWriter rg = new Class.RegistryWriter();
            try
            {

                rg.WriteKey("server", txtServer.Text);
                rg.WriteKey("database", txtDatabaseName.Text);
                string _user = Class.App.EncryptString(txtUser.Text, "UserID");
                string _pass = Class.App.EncryptString(txtPass.Text, "PasswordID");
                rg.WriteKey("user", _user);
                rg.WriteKey("pass", _pass);
                if (checkAutoUpdate.Checked)
                {
                    rg.WriteKey("autoupdate", "1");
                }
                else
                {
                    rg.WriteKey("autoupdate", "0");
                }

                MessageBox.Show("Lưu cấu hình thành công !");
               // this.Close();
            }
            catch
            {
                MessageBox.Show("Lưu cấu hình thất bại !");
            }
        }
コード例 #2
0
        private void btnCapNhat_Click(object sender, EventArgs e)
        {
            Class.RegistryWriter rg = new Class.RegistryWriter();
            try
            {
                rg.WriteKey("server", txtServer.Text);
                rg.WriteKey("database", txtDatabaseName.Text);
                string _user = Class.App.EncryptString(txtUser.Text, "UserID");
                string _pass = Class.App.EncryptString(txtPass.Text, "PasswordID");
                rg.WriteKey("user", _user);
                rg.WriteKey("pass", _pass);
                if (checkAutoUpdate.Checked)
                {
                    rg.WriteKey("autoupdate", "1");
                }
                else
                {
                    rg.WriteKey("autoupdate", "0");
                }

                MessageBox.Show("Lưu cấu hình thành công !");
                // this.Close();
            }
            catch
            {
                MessageBox.Show("Lưu cấu hình thất bại !");
            }
        }
コード例 #3
0
        private void frmCauHinh_Load(object sender, EventArgs e)
        {
            try
            {
                Class.RegistryWriter rg = new Class.RegistryWriter();
                txtServer.Text       = rg.valuekey("server");
                txtDatabaseName.Text = rg.valuekey("database");
                txtUser.Text         = Class.App.DecryptString(rg.valuekey("user"), "UserID");
                txtPass.Text         = Class.App.DecryptString(rg.valuekey("pass"), "PasswordID");

                txtCmts.Text       = rg.valuekey("CMTS");
                txtPassTelnet.Text = Class.App.DecryptString(rg.valuekey("CMTS_TEL"), "PasswordID");
                txtPassLogin.Text  = Class.App.DecryptString(rg.valuekey("CMTS_pass"), "PasswordID");
                txtLogin.Text      = Class.App.DecryptString(rg.valuekey("CMTS_user"), "UserID");

                if (rg.valuekey("autoupdate") == "1")
                {
                    checkAutoUpdate.Checked = true;
                }
                else
                {
                    checkAutoUpdate.Checked = false;
                }
            }
            catch { }
        }
コード例 #4
0
ファイル: frmCauHinh.cs プロジェクト: tayeumi/HFC
        private void frmCauHinh_Load(object sender, EventArgs e)
        {
            try
            {
                Class.RegistryWriter rg = new Class.RegistryWriter();
                txtServer.Text = rg.valuekey("server");
                txtDatabaseName.Text = rg.valuekey("database");
                txtUser.Text = Class.App.DecryptString(rg.valuekey("user"), "UserID");
                txtPass.Text = Class.App.DecryptString(rg.valuekey("pass"), "PasswordID");

                txtCmts.Text = rg.valuekey("CMTS");
                txtPassTelnet.Text = Class.App.DecryptString(rg.valuekey("CMTS_TEL"), "PasswordID");
                txtPassLogin.Text = Class.App.DecryptString(rg.valuekey("CMTS_pass"), "PasswordID");
                txtLogin.Text = Class.App.DecryptString(rg.valuekey("CMTS_user"), "UserID");

                if (rg.valuekey("autoupdate") == "1")
                {
                    checkAutoUpdate.Checked = true;
                }
                else
                {
                    checkAutoUpdate.Checked = false;
                }
            }
            catch { }
        }
コード例 #5
0
        private void frmMain_FormClosed(object sender, FormClosedEventArgs e)
        {
            string skin = defaultGiaoDien.LookAndFeel.SkinName;

            Class.RegistryWriter rg = new Class.RegistryWriter();
            rg.WriteKey("style", skin);
            Application.Exit();
        }
コード例 #6
0
        private void frmMain_Load(object sender, EventArgs e)
        {
            Class.RegistryWriter rg = new Class.RegistryWriter();
            this.defaultGiaoDien.LookAndFeel.SkinName = rg.valuekey("style");

            this.Text = this.Text + " " + config("Config.xml", "company") + " V" + config("Config.xml", "version");
            btnDangNhap_ItemClick(null, null);
            SkinHelper.InitSkinPopupMenu(barSubItem4);
        }
コード例 #7
0
ファイル: frmDangNhap.cs プロジェクト: tayeumi/HFC
        private void frmDangNhap_Load(object sender, EventArgs e)
        {
            Class.RegistryWriter rg = new Class.RegistryWriter();
            string user             = rg.valuekey("user_client");

            if (user != "Blue" & user != "")
            {
                txtTaiKhoan.Text     = user;
                checkLuuPass.Checked = true;
            }
            else
            {
                txtTaiKhoan.Text     = "";
                checkLuuPass.Checked = false;
            }
        }
コード例 #8
0
 private void Checkfile_Tick(object sender, EventArgs e)
 {
     Class.RegistryWriter rg = new Class.RegistryWriter();
     if (rg.valuekey("autoupdate") == "1")
     {
         Checkfile.Enabled = false;
         checkfileDll();
         kiemtraphienban();
         IntroTime.Enabled = true;
     }
     else
     {
         Checkfile.Enabled = false;
         IntroTime.Enabled = true;
     }
 }
コード例 #9
0
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            Class.RegistryWriter rg = new Class.RegistryWriter();
            try
            {
                rg.WriteKey("CMTS", txtCmts.Text);
                string _passtel = Class.App.EncryptString(txtPassTelnet.Text, "PasswordID");
                rg.WriteKey("CMTS_TEL", _passtel);

                string _user = Class.App.EncryptString(txtLogin.Text, "UserID");
                string _pass = Class.App.EncryptString(txtPassLogin.Text, "PasswordID");
                rg.WriteKey("CMTS_user", _user);
                rg.WriteKey("CMTS_pass", _pass);

                MessageBox.Show("Lưu cấu hình thành công !");
                // this.Close();
            }
            catch
            {
                MessageBox.Show("Lưu cấu hình thất bại !");
            }
        }
コード例 #10
0
ファイル: frmCauHinh.cs プロジェクト: tayeumi/HFC
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            Class.RegistryWriter rg = new Class.RegistryWriter();
            try
            {
                rg.WriteKey("CMTS", txtCmts.Text);
                string _passtel = Class.App.EncryptString(txtPassTelnet.Text, "PasswordID");
                rg.WriteKey("CMTS_TEL", _passtel);

                string _user = Class.App.EncryptString(txtLogin.Text, "UserID");
                string _pass = Class.App.EncryptString(txtPassLogin.Text, "PasswordID");
                rg.WriteKey("CMTS_user", _user);
                rg.WriteKey("CMTS_pass", _pass);

                MessageBox.Show("Lưu cấu hình thành công !");
               // this.Close();
            }
            catch
            {
                MessageBox.Show("Lưu cấu hình thất bại !");
            }
        }
コード例 #11
0
ファイル: DbAccess.cs プロジェクト: tayeumi/HFC
 public static string get_config(string _id)
 {
     RegistryWriter rg = new RegistryWriter();
     return rg.valuekey(_id);
 }
コード例 #12
0
ファイル: frmMain.cs プロジェクト: tayeumi/HFC
        private void frmMain_Load(object sender, EventArgs e)
        {
            Class.RegistryWriter rg = new Class.RegistryWriter();
            this.defaultGiaoDien.LookAndFeel.SkinName = rg.valuekey("style");

            this.Text = this.Text + " " + config("Config.xml", "company") + " V" + config("Config.xml", "version");
            btnDangNhap_ItemClick(null, null);
            SkinHelper.InitSkinPopupMenu(barSubItem4);
        }
コード例 #13
0
ファイル: frmMain.cs プロジェクト: tayeumi/HFC
 private void frmMain_FormClosed(object sender, FormClosedEventArgs e)
 {
     string skin = defaultGiaoDien.LookAndFeel.SkinName;
     Class.RegistryWriter rg = new Class.RegistryWriter();
     rg.WriteKey("style", skin);
     Application.Exit();
 }
コード例 #14
0
ファイル: frmDangNhap.cs プロジェクト: tayeumi/HFC
        private void btnDangNhap_Click(object sender, EventArgs e)
        {
            if (txtTaiKhoan.Text.Length < 1)
            {
                MessageBox.Show(" Chưa nhập đủ thông tin ");
                return;
            }
            if (txtTaiKhoan.Text == "admin"& txtMatkhau.Text=="1111")
            {
                // MessageBox.Show(" Đăng nhập thành công !");
                taikhoan = txtTaiKhoan.Text;
                Class.App.client_User = txtTaiKhoan.Text;
                if (checkLuuPass.Checked)
                {
                    Class.RegistryWriter rg = new Class.RegistryWriter();
                    rg.WriteKey("user_client", txtTaiKhoan.Text);
                }
                else
                {
                    Class.RegistryWriter rg = new Class.RegistryWriter();
                    rg.WriteKey("user_client", "");

                }

                this.Close();
            }
            if (txtTaiKhoan.Text == "user" & txtMatkhau.Text == "user")
            {
                // MessageBox.Show(" Đăng nhập thành công !");
                taikhoan = txtTaiKhoan.Text;
                Class.App.client_User = txtTaiKhoan.Text;
                if (checkLuuPass.Checked)
                {
                    Class.RegistryWriter rg = new Class.RegistryWriter();
                    rg.WriteKey("user_client", txtTaiKhoan.Text);
                }
                else
                {
                    Class.RegistryWriter rg = new Class.RegistryWriter();
                    rg.WriteKey("user_client", "");

                }
                this.Close();
            }
                if (txtTaiKhoan.Text == "super" & txtMatkhau.Text == "super")
            {
                // MessageBox.Show(" Đăng nhập thành công !");
                taikhoan = txtTaiKhoan.Text;
                Class.App.client_User = txtTaiKhoan.Text;
                if (checkLuuPass.Checked)
                {
                    Class.RegistryWriter rg = new Class.RegistryWriter();
                    rg.WriteKey("user_client", txtTaiKhoan.Text);
                }
                else
                {
                    Class.RegistryWriter rg = new Class.RegistryWriter();
                    rg.WriteKey("user_client", "");

                }

                this.Close();
            }
                if (txtTaiKhoan.Text == "lapmoi" & txtMatkhau.Text == "lapmoilapmoi")
                {
                    // MessageBox.Show(" Đăng nhập thành công !");
                    taikhoan = txtTaiKhoan.Text;
                    Class.App.client_User = txtTaiKhoan.Text;
                    if (checkLuuPass.Checked)
                    {
                        Class.RegistryWriter rg = new Class.RegistryWriter();
                        rg.WriteKey("user_client", txtTaiKhoan.Text);
                    }
                    else
                    {
                        Class.RegistryWriter rg = new Class.RegistryWriter();
                        rg.WriteKey("user_client", "");

                    }

                    this.Close();
                }
        }
コード例 #15
0
ファイル: frmDangNhap.cs プロジェクト: tayeumi/HFC
 private void frmDangNhap_Load(object sender, EventArgs e)
 {
     Class.RegistryWriter rg = new Class.RegistryWriter();
     string user = rg.valuekey("user_client");
     if (user != "Blue" & user != "")
     {
         txtTaiKhoan.Text = user;
         checkLuuPass.Checked = true;
     }
     else
     {
         txtTaiKhoan.Text = "";
         checkLuuPass.Checked = false;
     }
 }
コード例 #16
0
        private void frmintro_Load(object sender, EventArgs e)
        {
            // delete first
            if (Application.StartupPath != "E:\\HFC Project\\HFC\\bin\\Debug") // lap trinh thi ko xoa va tai lai file nay
            {
                //if (System.IO.File.Exists("node.txt"))
                //{
                //    System.IO.File.Delete("node.txt");
                //}
                //if (System.IO.File.Exists("nodewarning.txt"))
                //{
                //    System.IO.File.Delete("nodewarning.txt");
                //}
                //if (System.IO.File.Exists("path.txt"))
                //{
                //    System.IO.File.Delete("path.txt");
                //}
            }
            Checkfile.Enabled = true;
            try
            {
                //if (rg.valuekey("media") == "Blue") // cai nay ko ko
                //{
                //    // Class.DataServices.media = "default_ring.wav";

                //}
                //else
                //{
                //    //  Class.DataServices.media = rg.valuekey("media");
                //}
                Class.RegistryWriter rg = new Class.RegistryWriter();
                Class.App.media = rg.valuekey("media");
                //string _user = Class.App.EncryptString("hrm", "UserID");
                //string _pass = Class.App.EncryptString("adminlbc", "PasswordID");
                //rg.WriteKey("user", _user);
                //rg.WriteKey("pass", _pass);
                if (rg.valuekey("autoupdate") == "Blue")
                {
                    rg.WriteKey("autoupdate", "1");
                }

                if (!Directory.Exists(@"Templates"))
                {
                    Directory.CreateDirectory(@"Templates");
                }

                if (!Directory.Exists(@"media"))
                {
                    Directory.CreateDirectory(@"media");
                }
                if (!Directory.Exists(@"Report"))
                {
                    Directory.CreateDirectory(@"Report");
                }
                if (!Directory.Exists(@"Team"))
                {
                    Directory.CreateDirectory(@"Team");
                }
            }
            catch { }
        }
コード例 #17
0
ファイル: frmDangNhap.cs プロジェクト: tayeumi/HFC
        private void btnDangNhap_Click(object sender, EventArgs e)
        {
            if (txtTaiKhoan.Text.Length < 1)
            {
                MessageBox.Show(" Chưa nhập đủ thông tin ");
                return;
            }
            if (txtTaiKhoan.Text == "admin" & txtMatkhau.Text == "1111")
            {
                // MessageBox.Show(" Đăng nhập thành công !");
                taikhoan = txtTaiKhoan.Text;
                Class.App.client_User = txtTaiKhoan.Text;
                if (checkLuuPass.Checked)
                {
                    Class.RegistryWriter rg = new Class.RegistryWriter();
                    rg.WriteKey("user_client", txtTaiKhoan.Text);
                }
                else
                {
                    Class.RegistryWriter rg = new Class.RegistryWriter();
                    rg.WriteKey("user_client", "");
                }

                this.Close();
            }
            if (txtTaiKhoan.Text == "user" & txtMatkhau.Text == "user")
            {
                // MessageBox.Show(" Đăng nhập thành công !");
                taikhoan = txtTaiKhoan.Text;
                Class.App.client_User = txtTaiKhoan.Text;
                if (checkLuuPass.Checked)
                {
                    Class.RegistryWriter rg = new Class.RegistryWriter();
                    rg.WriteKey("user_client", txtTaiKhoan.Text);
                }
                else
                {
                    Class.RegistryWriter rg = new Class.RegistryWriter();
                    rg.WriteKey("user_client", "");
                }
                this.Close();
            }
            if (txtTaiKhoan.Text == "super" & txtMatkhau.Text == "super")
            {
                // MessageBox.Show(" Đăng nhập thành công !");
                taikhoan = txtTaiKhoan.Text;
                Class.App.client_User = txtTaiKhoan.Text;
                if (checkLuuPass.Checked)
                {
                    Class.RegistryWriter rg = new Class.RegistryWriter();
                    rg.WriteKey("user_client", txtTaiKhoan.Text);
                }
                else
                {
                    Class.RegistryWriter rg = new Class.RegistryWriter();
                    rg.WriteKey("user_client", "");
                }

                this.Close();
            }
            if (txtTaiKhoan.Text == "lapmoi" & txtMatkhau.Text == "lapmoilapmoi")
            {
                // MessageBox.Show(" Đăng nhập thành công !");
                taikhoan = txtTaiKhoan.Text;
                Class.App.client_User = txtTaiKhoan.Text;
                if (checkLuuPass.Checked)
                {
                    Class.RegistryWriter rg = new Class.RegistryWriter();
                    rg.WriteKey("user_client", txtTaiKhoan.Text);
                }
                else
                {
                    Class.RegistryWriter rg = new Class.RegistryWriter();
                    rg.WriteKey("user_client", "");
                }

                this.Close();
            }
        }
コード例 #18
0
ファイル: Intro.cs プロジェクト: tayeumi/HFC
 private void Checkfile_Tick(object sender, EventArgs e)
 {
     Class.RegistryWriter rg = new Class.RegistryWriter();
     if (rg.valuekey("autoupdate") == "1")
     {
         Checkfile.Enabled = false;
         checkfileDll();
         kiemtraphienban();
         IntroTime.Enabled = true;
     }
     else
     {
         Checkfile.Enabled = false;
         IntroTime.Enabled = true;
     }
 }
コード例 #19
0
ファイル: Intro.cs プロジェクト: tayeumi/HFC
        private void frmintro_Load(object sender, EventArgs e)
        {
            // delete first
            if (Application.StartupPath != "E:\\HFC Project\\HFC\\bin\\Debug") // lap trinh thi ko xoa va tai lai file nay
            {
                //if (System.IO.File.Exists("node.txt"))
                //{
                //    System.IO.File.Delete("node.txt");
                //}
                //if (System.IO.File.Exists("nodewarning.txt"))
                //{
                //    System.IO.File.Delete("nodewarning.txt");
                //}
                //if (System.IO.File.Exists("path.txt"))
                //{
                //    System.IO.File.Delete("path.txt");
                //}
            }
               Checkfile.Enabled = true;
               try
               {

               //if (rg.valuekey("media") == "Blue") // cai nay ko ko
               //{
               //    // Class.DataServices.media = "default_ring.wav";

               //}
               //else
               //{
               //    //  Class.DataServices.media = rg.valuekey("media");
               //}
               Class.RegistryWriter rg = new Class.RegistryWriter();
               Class.App.media = rg.valuekey("media");
               //string _user = Class.App.EncryptString("hrm", "UserID");
               //string _pass = Class.App.EncryptString("adminlbc", "PasswordID");
               //rg.WriteKey("user", _user);
               //rg.WriteKey("pass", _pass);
               if (rg.valuekey("autoupdate") == "Blue")
               {
                   rg.WriteKey("autoupdate", "1");
               }

               if (!Directory.Exists(@"Templates"))
               {
                   Directory.CreateDirectory(@"Templates");
               }

               if (!Directory.Exists(@"media"))
               {
                   Directory.CreateDirectory(@"media");
               }
               if (!Directory.Exists(@"Report"))
               {
                   Directory.CreateDirectory(@"Report");
               }
               if (!Directory.Exists(@"Team"))
               {
                   Directory.CreateDirectory(@"Team");
               }
               }
               catch { }
        }
コード例 #20
0
ファイル: DbAccess.cs プロジェクト: tayeumi/HFC
        public static string get_config(string _id)
        {
            RegistryWriter rg = new RegistryWriter();

            return(rg.valuekey(_id));
        }