예제 #1
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            //注册事件的处理
            while (true)
            {
                //生成loginForm
                LoginForm newLoginForm = new LoginForm();
                DialogResult newLoginFormResult = newLoginForm.ShowDialog();

                if (newLoginFormResult == DialogResult.OK)
                {
                    HomeForm newHomeFrom = new HomeForm();
                    newHomeFrom.userinfo = newLoginForm.userinfo;
                    newLoginForm.Close();
                    newLoginForm.Dispose();
                    Application.Run(newHomeFrom);
                    break;
                }
                //进入注册界面
                if (newLoginFormResult == DialogResult.Abort)
                {
                    newLoginForm.Close();
                    newLoginForm.Dispose();
                    RegistForm newRegistForm = new RegistForm();
                    DialogResult newRegistFormResult = newRegistForm.ShowDialog();
                    //注册成功转到登录界面
                    if (newRegistFormResult == DialogResult.OK)
                    {
                        newRegistForm.Close();
                        newRegistForm.Dispose();
                        continue;
                    }
                    //返回登录界面
                    if (newRegistFormResult == DialogResult.Retry)
                    {
                        continue;
                    }
                    break;
                }
                //点击退出
                break;
            }
        }
예제 #2
0
파일: Program.cs 프로젝트: jpmac26/AODX
        static void Main()
        {
            #if (DEBUG)
            debug = true;
            #endif

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            LoginForm loginForm = new LoginForm();

            Application.Run(loginForm);
            if (loginForm.DialogResult == DialogResult.OK)
            {
                charList = loginForm.charList;
                musicList = loginForm.musicList;
                eList = loginForm.eviList;

                CharForm CharSelect = new CharForm();
                CharSelect.clientSocket = loginForm.clientSocket;
                //CharSelect.clientSocket = connection;
                CharSelect.charList = charList;

                Application.Run(CharSelect);
                if (CharSelect.DialogResult == DialogResult.OK)
                {
                    ClientForm AODXClientForm = new ClientForm();
                    AODXClientForm.clientSocket = CharSelect.clientSocket;
                    AODXClientForm.eviList = eList;
                    AODXClientForm.songs = musicList;
                    AODXClientForm.strName = CharSelect.strName;
                    try
                    {
                        Application.Run(AODXClientForm);
                    }
                    catch (Exception ex)
                    {
                        if (debug)
                            MessageBox.Show(ex.Message + ".\r\n" + ex.StackTrace.ToString(), "AODXClient", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
        }
예제 #3
0
 private void LoginButton_Click(object sender, EventArgs e)
 {
     // Show the Login Form
     LoginForm loginform = new LoginForm();
     loginform.ShowDialog(this);
     if (loginform.Completed)
     {
         String username = loginform.Username;
         String password = loginform.Password;
         byte[] pwbytes = MD5.Create().ComputeHash(Encoding.Default.GetBytes(password));
         StringBuilder sb = new StringBuilder();
         foreach (byte digestbyte in pwbytes)
         {
             sb.Append(digestbyte.ToString("x2"));
         }
         String pwdigest = sb.ToString().ToUpper();
         MessageBox.Show("Username: "******"\nDigest: " + pwdigest);
         // TODO: Insert login logic here
         IsLoggedIn = true;
     }
 }
예제 #4
0
 private void loginMenuItem_Click(object sender, EventArgs e)
 {
     if (loginForm != null)
         showError("Login Form is already open");
     else
     {
         if (currentPlayer == null)
         {
             loginForm = new LoginForm(this);
             loginForm.Show();
         }
         else
             showError("Error: Please logout first");
     }
 }
예제 #5
0
 public Form_Timing(LoginForm form)
 {
     InitializeComponent();
     this.form = form;
 }
예제 #6
0
        private void LoginMenuItem_Click(object sender, EventArgs e)
        {
            LoginForm loginForm = new LoginForm();

            loginForm.Show();
        }