Exemplo n.º 1
0
        public FormMy(FormMenu formMenu)
        {
            ac.id    = formMenu.logId();
            ac.level = formMenu.loglevel();

            InitializeComponent();
        }
Exemplo n.º 2
0
 public FormShop(FormMenu formMenu)
 {
     ac.level = formMenu.loglevel();
     ac.money = formMenu.logmoney();
     ac.name  = formMenu.logname();
     ac.id    = formMenu.logId();
     InitializeComponent();
     ShopTabs();
 }
Exemplo n.º 3
0
 public FormStart(FormMenu formMenu)
 {
     InitializeComponent();
     KeyPreview      = true;
     timer1.Enabled  = true;
     timer1.Interval = 1000;
     ac.id           = formMenu.logId();
     ac.bestround    = formMenu.logbestrnd();
     ac.bestscore    = formMenu.logbesetscr();
     ac.level        = formMenu.loglevel();
     ac.lifetem      = formMenu.loglifetem();
     ac.timetem      = formMenu.logtimetem();
 }
Exemplo n.º 4
0
        //로그인 버튼 누를 시
        private void button1_Click(object sender, EventArgs e)
        {
            var Conn = new OleDbConnection(StrSQL);

            Conn.Open(); //DB열기
            string          OleDb = "select * from account where (A_id ='" + this.id_txt.Text + "')";
            var             comm = new OleDbCommand(OleDb, Conn);
            OleDbDataReader myRead = comm.ExecuteReader();
            int             loginok = 0, idok = 0;
            int             count = 0;

            try
            {
                while (myRead.Read())
                {
                    var strArray = new String[] { myRead["A_id"].ToString(), myRead["A_password"].ToString(), myRead["A_name"].ToString() };
                    count++;
                    ac.id       = myRead["A_id"].ToString();       //아이디 찾으면 id에 넣기
                    ac.password = myRead["A_password"].ToString(); //그 아이디의 비밀번호 넣기
                    ac.name     = myRead["A_name"].ToString();
                }
                myRead.Close();
                Conn.Close();
                if (count == 0)
                {
                    throw new loginExpt();
                }
            }
            catch (loginExpt)
            {
                MessageBox.Show("존재하지 않는 아이디 입니다.");
                id_txt.Focus();
                loginok = -1;
                idok    = -1;
            }
            if (ac.password != pass_txt.Text.ToString() && idok != -1)
            {
                MessageBox.Show("비밀번호를 다시 입력해주세요.");
                pass_txt.Focus();
                loginok = -2;
            }
            if (loginok == 0)
            {
                //로그인 성공 시 메뉴화면띄우고 로그인 창 닫기
                MessageBox.Show(ac.id + "님 로그인");
                this.Hide();
                FormMenu form_menu = new FormMenu(this);
                form_menu.ShowDialog();
            }
        }