コード例 #1
0
ファイル: Register.cs プロジェクト: laidehua1/notebook
        private void button_register_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(textBox_User.Text) && !string.IsNullOrEmpty(textBox_RePassWord.Text))
            {
                string code = igl.ED_code(textBox_RePassWord.Text, true);
                string sql  = string.Format("insert into {0} values('{1}','{2}',0,0)",
                                            GlobalParam.TableName_User, textBox_User.Text, code);
                dh.ExecuteNonQuery(sql);

                log.AddComboBoxItems(textBox_User.Text);
                this.Close();
            }
        }
コード例 #2
0
        private void button_Login_Click(object sender, EventArgs e)
        {
            string code = igl.ED_code(ActiveUser["PassWord"].ToString(), false);

            //MessageBox.Show("点击登录了", "提示");
            if (textBox_PassWord.Text.CompareTo(code) != 0)
            {
                MessageBox.Show("密码错误!", "提示");
                textBox_PassWord.Text = "";
                textBox_PassWord.Focus();
            }
            else
            {
                GlobalParam.Active_User = this.comboBox_Account.Text;
                if (checkBox_remberPW.Checked)
                {
                    ActiveUser["Rember_PW"] = 1;
                }
                else
                {
                    ActiveUser["Rember_PW"] = 0;
                }
                if (checkBox_AutoLogin.Checked)
                {
                    ActiveUser["AutoLogin"] = 1;
                }
                else
                {
                    ActiveUser["AutoLogin"] = 0;
                }

                WriteNote wn = new WriteNote(this);
                wn.Show();
                dh.UpdateTable(UserDT);

                this.Hide();
            }
        }