コード例 #1
0
ファイル: frmLogin.cs プロジェクト: trogalko/kalibrasi
        private void loginWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            Chilkat.Crypt2 crypt = new Chilkat.Crypt2();
            crypt.UnlockComponent("Crypt!TEAM!BEAN_34F4144DpR6G");
            crypt.CryptAlgorithm = "aes";
            crypt.CipherMode = "cbc";
            crypt.KeyLength = 128;
            crypt.SecretKey = crypt.GenerateSecretKey(txtUser.Text);
            crypt.EncodingMode = "base64";

            if (e.Error != null)
            {
                MessageBox.Show(e.Error.Message);
            }
            if (frmStatusBar != null)
            {
                frmStatusBar.Close();
            }

            if (Kalibrasi.global_variable.global.gcPASSWORD == crypt.EncryptStringENC(txtPassword.Text))
            {
                this.Close();
            }
            else
            {
                Kalibrasi.global_variable.global.gcUSERID = lcUserId;
            }
        }
コード例 #2
0
ファイル: frmLogin.cs プロジェクト: trogalko/kalibrasi
        private void cmdOK_Click(object sender, EventArgs e)
        {
            Chilkat.Crypt2 crypt = new Chilkat.Crypt2();
            crypt.UnlockComponent("Crypt!TEAM!BEAN_34F4144DpR6G");
            crypt.CryptAlgorithm = "aes";
            crypt.CipherMode = "cbc";
            crypt.KeyLength = 128;
            crypt.SecretKey = crypt.GenerateSecretKey(txtUser.Text);
            crypt.EncodingMode = "base64";
            lcUserId = Kalibrasi.global_variable.global.gcUSERID;
            Kalibrasi.global_variable.global.gcUSERID = txtUser.Text;

            frmStatusBar = new frmStatusBar();
            frmStatusBar.Show();
            frmStatusBar.CancelButtonClicked += new CancelButtonEventHandler(frmStatusBar_CancelButtonClicked);
            loginWorker.RunWorkerAsync();
        }