private void btnLogin_Click(object sender, EventArgs e) { HttpManager.Login(textBox1.Text, textBox2.Text, cookieString); string _cookie = HttpManager.GetMain(cookieString); //new ReservationFrm(cookieString).Show(); }
private void btnLogin_Click(object sender, EventArgs e) { string resultHtml = HttpManager.Login(textBox1.Text, textBox2.Text, _cookieString); if (resultHtml.Contains("<div class=\"login_error\">")) { const string searchText = "<div class=\"login_error\">"; string resultText = resultHtml.Substring(resultHtml.IndexOf(searchText) + searchText.Length, resultHtml.IndexOf("</p>", resultHtml.IndexOf(searchText)) - resultHtml.IndexOf(searchText) - searchText.Length) .Replace("<p>", "") .Replace("<strong>", "") .Replace("</strong>", "") .Trim(); MessageBox.Show(resultText); Logging(textBox1.Text + " 아이디 로그인 에러 ", resultText); return; } else { resultHtml = HttpManager.GetMain(_cookieString); const string searchText = "<span class=\"name\">"; string resultText = resultHtml.Substring(resultHtml.IndexOf(searchText) + searchText.Length, resultHtml.IndexOf("</span>", resultHtml.IndexOf(searchText)) - resultHtml.IndexOf(searchText) - searchText.Length) //.Replace("<p>", "") //.Replace("<strong>", "") //.Replace("</strong>", "") .Trim(); Logging(textBox1.Text + " 로그인", resultText, Color.Blue); _userName = resultText; toolStripStatusLabel1.Text = _userName + @" 로그인"; } gboption.Enabled = gbReservation.Enabled = gbSite.Enabled = gboption.Enabled = true; cbLodge.DataSource = HttpManager.GetForestLodge(_cookieString); cbLodge.ValueMember = "Code"; cbLodge.DisplayMember = "Name"; //lbReservation.DisplayMember = "Desc"; cbReservation.DisplayMember = "Desc"; var data = new[] { new { Value = "1", Name = "1박2일" }, new { Value = "2", Name = "2박3일" }, new { Value = "3", Name = "3박4일" } }; cbPeriod.DataSource = data; cbPeriod.ValueMember = "Value"; cbPeriod.DisplayMember = "Name"; cbLodge.SelectedValueChanged += cbLodge_SelectedIndexChanged; cbFacility.SelectedIndexChanged += CbFacilityOnSelectedIndexChanged; gbAccont.Enabled = false; }