コード例 #1
0
ファイル: Program.cs プロジェクト: treejames/P2PHomework
        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
ファイル: GUI.cs プロジェクト: michederoide/Battle.LAN
 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
ファイル: MainForm.cs プロジェクト: Nitzahon/10212-TicTacToe
 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();
        }