static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Glo.GloInit(); Application.Run(new Form1()); }
private void pictureBox10_MouseClick(object sender, MouseEventArgs e) { DialogResult dr = MessageBox.Show(this, "确定退出?", "退出登录", MessageBoxButtons.OKCancel); if (dr == DialogResult.OK) { Glo.user.IsUser = false; Glo.UpdateStudnet(Glo.user); ReloadUserPic(); Glo.user = null; Form1.form1.ReloadUserPic(); } }
private void button1_Click(object sender, EventArgs e) { string pwd = MD5(textBox2.Text); todayClassCrawler.GetHtml(comboBox1.Text, pwd, textBox3.Text); int flag = todayClassCrawler.Sucesse(); if (flag == 3) { todayClassCrawler.GetHtml2(); todayClassCrawler.GetTodayClass(); Glo.user = Glo.FindStudent(comboBox1.Text, textBox2.Text); if (Glo.user == null && Glo.user == null) { Glo.user = new Student(comboBox1.Text, textBox2.Text, true, todayClassCrawler.list); Glo.AddStudnet(Glo.user); } else { Glo.user.IsUser = true; Glo.UpdateStudnet(Glo.user); } Glo.GetAllStudents(); comboBox1.DataSource = new List <Student>(); comboBox1.DataSource = Glo.students; Form1.form1.ReloadUserPic(); Dispose(); } else if (flag == 0) { MessageBox.Show("验证码错误!"); pictureBox1.Image = todayClassCrawler.getCodeStream(); } else if (flag == 1) { MessageBox.Show("用户名/密码错误!"); pictureBox1.Image = todayClassCrawler.getCodeStream(); } else { MessageBox.Show("网络开小差了=_=!"); GetPic(); } }