//做一些预处理的工作 private void MainForm_Load(object sender, EventArgs e) { globals.KS = GetWeb("http://jw1.hustwenhua.net/("+globals.dynamicCode+")/xskscx.aspx?xh=" + globals.userid + "&xm=" + globals.username + "&gnmkdm=N121602"); if(globals.KS!=null) { MessageBox.Show("最近有考试哦!,请查看", "考试安排"); KS ks1 = new KS(); ks1.Show(); } webBrowser1.Navigate("http://jw1.hustwenhua.net/(" + globals.dynamicCode + ")/xs_main.aspx?xh=" + globals.userid); //获取学生的姓名 string temp=globals.indexHtml; string first = temp.Substring(temp.LastIndexOf("\"xhxm\">") +7 ); string last = first.Substring(0, first.LastIndexOf("同学")); label1.Text += last; globals.username=last; }
private void button2_Click(object sender, EventArgs e) { globals.KS = GetWeb("http://jw1.hustwenhua.net/("+globals.dynamicCode+")/xskscx.aspx?xh=" + globals.userid + "&xm=" + globals.username + "&gnmkdm=N121603"); KS ks = new KS(); ks.Show(); }