static void test2() { StreamReader sr = new StreamReader(MyBK.Lib.Data.PathData.config); String logined = sr.ReadLine(); if (logined == null) { sr.Close(); return; } String user = sr.ReadLine(); String pass = sr.ReadLine(); sr.Close(); MyBKDKMH dkmh = new MyBKDKMH(user, pass); String html = dkmh.getDanhSachLoaiDangKy(); LoaiDangKy[] l = MyBK.Lib.Parser.XMLParser.getDSLoaiDangKy(html); StreamWriter sw = new StreamWriter("log.html", false, Encoding.UTF8); sw.Write(html); LoaiDangKy li = null; for (int i = 0; i < l.Length; i++) { if (l[i].tenLoaiDK.IndexOf("Kết") >= 0) { sw.WriteLine(l[i].hocKyID + "\n" + l[i].tenLoaiDK); li = l[i]; } } html = dkmh.getDanhSachDotDK(li.hocKyID); DotDangKy[] d = XMLParser.getDSDotDangKy(html); html = dkmh.getLichDangKy(d[0].idDotDangKy, d[0].idDotDangKy); html = dkmh.getThongTinNhomLopMonHoc("14014"); sw.Write(html); sw.Close(); Console.WriteLine("Done"); }
public XemmyBKDKMH() { InitializeComponent(); nhomLopHeader.setHeader(); dkmh = new MyBKDKMH(); String html = dkmh.getDanhSachLoaiDangKy(); LoaiDangKy[] listLoaiDK = XMLParser.getDSLoaiDangKy(html); comboBox_loaiDK.DisplayMember = "KeyValuePair<string, LoaiDangKy>.Key"; for (int i = 0; i < listLoaiDK.Length; i++) { if (listLoaiDK[i].tenLoaiDK.IndexOf("Kết") >= 0) { KeyValuePair <string, LoaiDangKy> item = new KeyValuePair <string, LoaiDangKy>(listLoaiDK[i].tenLoaiDK, listLoaiDK[i]); comboBox_loaiDK.Items.Add(item); } } }