Esempio n. 1
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();
        }
Esempio n. 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 !");
            }
        }
Esempio n. 3
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 !");
            }
        }
Esempio n. 4
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 !");
            }
        }
Esempio n. 5
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 !");
            }
        }
Esempio n. 6
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();
 }
Esempio n. 7
0
        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();
                }
        }
Esempio n. 8
0
        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();
            }
        }
Esempio n. 9
0
File: Intro.cs Progetto: 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 { }
        }
Esempio n. 10
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 { }
        }