コード例 #1
0
        private void frmSystemOptimize_FormClosing(object sender, FormClosingEventArgs e)
        {
            this.Hide();
            frmCony main = new frmCony();

            main.Show();
        }
コード例 #2
0
ファイル: frmCheck.cs プロジェクト: randianb/DownLoadDemo
        private void frmCheck_Load(object sender, EventArgs e)
        {
            string strg = Application.StartupPath.ToString();

            strg  = strg.Substring(0, strg.LastIndexOf("\\"));
            strg  = strg.Substring(0, strg.LastIndexOf("\\"));
            strg += @"\ConyData.mdb";
            OleDbConnection conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data source=" + strg);

            conn.Open();
            OleDbCommand cmd  = new OleDbCommand("select PassStr from tb_Admin where ID=1", conn);
            string       flag = cmd.ExecuteScalar().ToString();

            if (flag == "ls")
            {
                this.Hide();
                frmCony cony = new frmCony();
                cony.Show();
            }
            else
            {
                this.Hide();
                frmLogin login = new frmLogin();
                login.Show();
            }
        }
コード例 #3
0
        private void frmSystemCheck_FormClosing(object sender, FormClosingEventArgs e)
        {
            this.Hide();
            frmCony cony = new frmCony();

            cony.Show();
        }
コード例 #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            string strg = Application.StartupPath.ToString();

            strg  = strg.Substring(0, strg.LastIndexOf("\\"));
            strg  = strg.Substring(0, strg.LastIndexOf("\\"));
            strg += @"\ConyData.mdb";
            OleDbConnection conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data source=" + strg);

            if (txtUserPassword.Text.Trim() == "")
            {
                txtUserPassword.Focus();
            }
            else
            {
                conn.Open();
                OleDbCommand    cmd = new OleDbCommand("select * from tb_Admin where PassStr='" + txtUserPassword.Text.Trim() + "'", conn);
                OleDbDataReader sdr = cmd.ExecuteReader();
                sdr.Read();
                if (sdr.HasRows)
                {
                    sdr.Close();
                    conn.Close();
                    this.Hide();
                    frmCony cony = new frmCony();
                    cony.Show();
                }
                else
                {
                    this.Text = "°²È«ÃÜÂë´íÎó";
                }
            }
        }