public void AppLoginTapped(object sender, TappedRoutedEventArgs args) { InvalidPassword = false; SlideDistance = Window.Current.Bounds.Height * -1; if (!string.IsNullOrWhiteSpace(Password) && !string.IsNullOrWhiteSpace(PwdBox.Password) && PwdBox.Password == Password) { InvalidPassword = false; IsHideAppLockPanel = true; PwdBox.Password = string.Empty; //키보드 Hide PwdBox.IsEnabled = false; if (LoginSucceed != null) { LoginSucceed(this, new EventArgs()); } } else { InvalidPassword = true; PwdBox.Focus(FocusState.Programmatic); } }
//아이디 입력 후 엔터 private void enterKey(object sender, KeyEventArgs e) { id = IDBox.Text.ToString(); if (e.KeyCode == Keys.Enter) { if (IDBox.Text.ToString().Equals("")) { IDBox.Focus(); MessageBox.Show("아이디를 입력해 주세요"); } else { PwdBox.Focus(); } } }
private void loginOk1() { id = IDBox.Text.ToString(); pwd = PwdBox.Text.ToString(); if (PwdBox.Text.ToString().Equals("")) { IDBox.Focus(); MessageBox.Show("아이디를 입력해 주세요"); } else if (IDBox.Text.ToString().Equals("")) { PwdBox.Focus(); MessageBox.Show("비밀번호를 입력해 주세요"); } else { string url = "https://daemuri.net/main/getSendAuth.do?id=" + id + "&pwd=" + pwd; //string url = "http://127.0.0.1:8080/main/getSendAuth.do?id=" + id + "&pwd=" + pwd; try { HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); request.Method = "POST"; request.ContentType = "Application/json;charset=utf-8"; string sendData = ""; byte[] buffer; buffer = Encoding.Default.GetBytes(sendData); request.ContentLength = buffer.Length; Stream sendStream = request.GetRequestStream(); sendStream.Write(buffer, 0, buffer.Length); sendStream.Close(); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); Stream respPostStream = response.GetResponseStream(); StreamReader readerPost = new StreamReader(respPostStream, Encoding.UTF8); string resultJson = readerPost.ReadToEnd(); if (!resultJson.Contains("<!DOCTYPE html")) { JObject obj = new JObject(); obj = JObject.Parse(resultJson); string rs = obj["rs"].ToString(); if (rs.Equals("fail")) { MessageBox.Show("등록된 사용자가 아닙니다."); this.Height = 218; } else { JObject obj2 = new JObject(); obj2 = JObject.Parse(rs); callcenter_idx = obj2["callcenter_idx"].ToString(); //MessageBox.Show("callcenter_idx = " + callcenter_idx); CidBox.Visible = true; button3.Visible = true; CidBox.Focus(); this.Height = 335; } } else { MessageBox.Show("등록된 사용자가 아닙니다."); this.Height = 217; } } catch (System.Net.WebException er) { MessageBox.Show(er.Message); } } }
private void Window_Loaded(object sender, RoutedEventArgs e) { PwdBox.Focus(); }