Exemple #1
0
        private void login_btn_Click(object sender, EventArgs e)
        {
            if (LoginSelector.SelectedIndex >= 0)
            {
                var LoginsData = LoginConfig.GetInstance.LoginsConfig;
                login_input.Text    = LoginsData.ClientLogin[LoginSelector.SelectedIndex];
                password_input.Text = LoginsData.ClientPassword[LoginSelector.SelectedIndex];
            }

            if (loginSave.Checked)
            {
                var iniParser = new IniFile(".\\MiniLauncher.ini");
                //DefaultLogin DefaultPassword [ClientSetting]
                iniParser.Write("DefaultLogin", login_input.Text, "ClientSetting");
                iniParser.Write("DefaultPassword", password_input.Text, "ClientSetting");
            }

            if (!string.IsNullOrEmpty(login_input.Text) && !string.IsNullOrEmpty(password_input.Text) ||
                login_input.Text.Length <= 13 && password_input.Text.Length <= 13)
            {
                networkClient.DoLogin(login_input.Text, password_input.Text);
                EnableLoginBtn(false);
            }
            else
            {
                MessageBox.Show(Lm.GetString("LoginPasswordCheck"),
                                Lm.GetString("Error"));
            }
        }
 private void login_btn_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(login_input.Text) && !string.IsNullOrEmpty(password_input.Text) ||
         login_input.Text.Length <= 13 && password_input.Text.Length <= 13)
     {
         networkClient.DoLogin(login_input.Text, password_input.Text);
         EnableLoginBtn(false);
     }
     else
     {
         MessageBox.Show(Lm.GetString("LoginPasswordCheck"),
                         Lm.GetString("Error"));
     }
 }