示例#1
0
        private void btuCheck_click(object sender, EventArgs e)
        {
            MyMember y = new MyMember();

            y.m_username = textBox1.Text;
            y.m_Password = textBox2.Text;

            if (checkBox1.Checked == true)
            {
                Settings.Default.username = textBox1.Text;
                Settings.Default.password = textBox2.Text;
                Settings.Default.Save();
            }


            y.ValidateUser(out bool checkresult);

            if (checkresult)
            {
                FrmMain frmMain = new FrmMain(); //產生Form2的物件,才可以使用它所提供的Method
                this.Visible    = false;         //將Form1隱藏。由於在Form1的程式碼內使用this,所以this為Form1的物件本身
                frmMain.Visible = true;          //顯示第二個視窗
            }
            else
            {
                MessageBox.Show("logon failed 失敗次數" + count + @"/3");
                count++;
            }
            if (count > 3)
            {
                Application.Exit();
            }
        }
示例#2
0
        private void button1_Click(object sender, EventArgs e)
        {
            MyMember newusers = new MyMember();
            bool     logon    = false;

            if (textBox2.Text == textBox3.Text)
            {
                newusers.CreateUser(out logon);



                if (logon == true)
                {
                    MessageBox.Show("logon successfully ");
                }
            }
        }
示例#3
0
        private void button3_Click(object sender, EventArgs e)
        {
            MyMember g = new MyMember();

            textBox1.Text = g.FindUsersByEmail(textBox3.Text);
        }
示例#4
0
        private void button1_Click(object sender, EventArgs e)
        {
            MyMember xx = new MyMember();

            textBox2.Text = xx.FindPasswordByName(textBox1.Text);
        }