private void Login_id() { string urlBase = @"https://allcleapp.azurewebsites.net/api/Users"; //기본 url string url = null; //json으로 쓰일 url url = urlBase + "/" + ID_Box.Text; //id 있는지 확인 var json = new WebClient().DownloadData(url); string Unicode = Encoding.UTF8.GetString(json); if (Unicode == "true") //있다 { App.ID = ID_Box.Text; ID.Visibility = Visibility.Collapsed; ID_Box.Visibility = Visibility.Collapsed; PW.Visibility = Visibility.Visible; Text.Text = "Password"; PW_Box.Focus(); } else if (ID_Box.Text == "") //id 입력을 안 했을 때 { System.Windows.MessageBox.Show("아이디를 입력해주세요"); } else //없다 { System.Windows.MessageBox.Show(ID_Box.Text + "는 존재하지 않는 아이디 입니다"); } }
private void ID_Box_KeyDown(object sender, KeyEventArgs e) { if (e.KeyData == Keys.Enter) { if (!PW_Box.Text.Equals("") && !(PW_Box.Text.Equals("Password") && PW_Box.ForeColor == Color.Gray)) { string loginCheck = loginReceive.loginReveiveToServer("userLogin", ID_Box.Text, PW_Box.Text); if (loginCheck.Equals("true")) { loginStausLabel.Text = ""; UserInfo.userId = ID_Box.Text; UserIP = UserGetIP.GetLocalIP(); UserInfo.userIP = UserIP; contextmenustripform.IconVisiblefalse(); loginformCheck = false; Mainform mainform = new Mainform(contextmenustripform); mainform.Show(); ID_Box.Clear(); PW_Box.Clear(); ID_Box.Focus(); this.Hide(); } else { loginStausLabel.Text = "ID 또는 PW가 일치하지 않습니다."; loginStausLabel.ForeColor = Color.Red; ID_Box.Clear(); //PW_Box.Clear(); PW_Box.Text = "Password"; PW_Box.ForeColor = Color.Gray; PW_Box.PasswordChar = '\0'; login_btn.BackColor = Color.White; login_btn.ForeColor = Color.Gray; login_btn.Enabled = false; ID_Box.Focus(); } } else { PW_Box.Focus(); } } }
private void PW_img_MouseDown(object sender, MouseButtonEventArgs e) { PW_Box.Focus(); }
private void PW__GotFocus(object sender, RoutedEventArgs e) //패스워드 누르는 칸 클릭시 { PW_Box.Focus(); //패스워드 창으로 포커스 가도록 }
private void PW_TextBox_GotFocus(object sender, RoutedEventArgs e) { PW_Box.Focus(); }
private void PW_TextBox_GotFocus(object sender, RoutedEventArgs e) { PW_TextBox.Visibility = Visibility.Collapsed; PW_Box.Focus(); }