Exemplo n.º 1
0
        public bool getStatus()
        {
            login = Login.get();
            url = login.homeUrl + "xf_xsqxxxk.aspx?xh=" + login.id + "&xm=" + login.urlName + "&gnmkdm=N121203";
            int i = 20;
            while (i-- > 0)
            {
                page = Url.readHtml(Url.getPageStream(url));
                if (page.Length > 100) break;
                Thread.Sleep(1000);
            }

            Url.writeFile(page, "E:\\elective.html");

            if (page == "" || checkClosed() == true) return false;

            string postData = GetPostData();
            i = 20;
            while (i-- > 0)
            {
                page = Url.readHtml(Url.getPostStream(url, postData));
                if (page.Length > 100) break;
                Thread.Sleep(1000);
            }

            Url.writeFile(page, "E:\\elective.post.html");

            return status = (ParseSelected() && ParseCurriculm());
        }
Exemplo n.º 2
0
 public static Login get()
 {
     if (self == null)
     {
         self = new Login();
     }
     return self;
 }
Exemplo n.º 3
0
 public FormMain()
 {
     controlChange = new ChangeControlShow(changeControlShow);
     addControl = new AddControl(addControlAction);
     setWbDT = new SetWebBowserDocText(setWbDocumentText);
     this.login = Login.get();
     InitializeComponent();
     score = new Score();
     elective = new Elective();
 }
Exemplo n.º 4
0
 public FormLogin()
 {
     this.login = Login.get();
     login.init();
     InitializeComponent();
 }
Exemplo n.º 5
0
 public Score()
 {
     login = Login.get();
 }
Exemplo n.º 6
0
 private void FormMain_Load(object sender, EventArgs e)
 {
     Location = Postion.getPostion(this, 0.4f, 0.4f, null);
     Activate();
     this.Text = "欢迎 " + Login.get().name + " 登录 " + this.Text;
 }
Exemplo n.º 7
0
        public static Dictionary <string, string> getUserInfoList()
        {
            string page = Url.readHtml(Url.getPageStream(Login.get().homeUrl + "xsgrxx.aspx?xh=" + Login.get().id + "&xm=" + Login.get().urlName + "&gnmkdm=N121501"));

            Dictionary <string, string> rt = new Dictionary <string, string>();
            //Url.writeFile(page, "E:\\info.html");

            int n = "</span>".Length;

            string name  = "";
            Regex  reg   = new Regex("<span id=\"xm\">(.+?)</span>");
            Match  match = reg.Match(page);

            if (match.Value != "")
            {
                name = match.Value.Substring("<span id=\"xm\">".Length, match.Value.Length - "<span id=\"xm\">".Length - n);
            }
            rt.Add("name", name);

            string id = "";

            reg   = new Regex("<span id=\"xh\">([0-9]+)</span>");
            match = reg.Match(page);
            if (match.Value != "")
            {
                id = match.Value.Substring("<span id=\"xh\">".Length, match.Value.Length - "<span id=\"xh\">".Length - n);
            }
            rt.Add("id", id);

            string sex = "";

            reg   = new Regex("<span id=\"lbl_xb\">(.+?)</span>");
            match = reg.Match(page);
            if (match.Value != "")
            {
                sex = match.Value.Substring("<span id=\"lbl_xb\">".Length, match.Value.Length - "<span id=\"lbl_xb\">".Length - n);
            }
            rt.Add("sex", sex);

            string ethnic = "";

            reg   = new Regex("<span id=\"lbl_mz\">(.+?)</span>");
            match = reg.Match(page);
            if (match.Value != "")
            {
                ethnic = match.Value.Substring("<span id=\"lbl_mz\">".Length, match.Value.Length - "<span id=\"lbl_mz\">".Length - n);
            }
            rt.Add("ethnic", ethnic);

            string political = "";

            reg   = new Regex("<span id=\"lbl_zzmm\">(.+?)</span>");
            match = reg.Match(page);
            if (match.Value != "")
            {
                political = match.Value.Substring("<span id=\"lbl_zzmm\">".Length, match.Value.Length - "<span id=\"lbl_zzmm\">".Length - n);
            }
            rt.Add("political", political);

            string className = "";

            reg   = new Regex("<span id=\"lbl_xzb\">(.+?)</span>");
            match = reg.Match(page);
            if (match.Value != "")
            {
                className = match.Value.Substring("<span id=\"lbl_xzb\">".Length, match.Value.Length - "<span id=\"lbl_xzb\">".Length - n);
            }
            rt.Add("className", className);

            string grade = "";

            reg   = new Regex("<span id=\"lbl_dqszj\">(.+?)</span>");
            match = reg.Match(page);
            if (match.Value != "")
            {
                grade = match.Value.Substring("<span id=\"lbl_dqszj\">".Length, match.Value.Length - "<span id=\"lbl_dqszj\">".Length - n);
            }
            rt.Add("grade", grade);

            string faculty = "";

            reg   = new Regex("<span id=\"lbl_xy\">(.+?)</span>");
            match = reg.Match(page);
            if (match.Value != "")
            {
                faculty = match.Value.Substring("<span id=\"lbl_xy\">".Length, match.Value.Length - "<span id=\"lbl_xy\">".Length - n);
            }
            rt.Add("faculty", faculty);

            string discipline = "";

            reg   = new Regex("<span id=\"lbl_zymc\">(.+?)</span>");
            match = reg.Match(page);
            if (match.Value != "")
            {
                discipline = match.Value.Substring("<span id=\"lbl_zymc\">".Length, match.Value.Length - "<span id=\"lbl_zymc\">".Length - n);
            }
            rt.Add("discipline", discipline);

            string direction = "";

            reg   = new Regex("<span id=\"lbl_zyfx\">(.+?)</span>");
            match = reg.Match(page);
            if (match.Value != "")
            {
                direction = match.Value.Substring("<span id=\"lbl_zyfx\">".Length, match.Value.Length - "<span id=\"lbl_zyfx\">".Length - n);
            }
            rt.Add("direction", direction);

            string year = "";

            reg   = new Regex("<span id=\"lbl_xz\">([1-9])</span>");
            match = reg.Match(page);
            if (match.Value != "")
            {
                year = match.Value.Substring("<span id=\"lbl_xz\">".Length, match.Value.Length - "<span id=\"lbl_xz\">".Length - n) + "年";
            }
            rt.Add("year", year);

            string level = "";

            reg   = new Regex("<span id=\"lbl_CC\">(.+?)</span>");
            match = reg.Match(page);
            if (match.Value != "")
            {
                level = match.Value.Substring("<span id=\"lbl_CC\">".Length, match.Value.Length - "<span id=\"lbl_CC\">".Length - n);
            }
            rt.Add("level", level);

            string idcard = "";

            reg   = new Regex("<span id=\"lbl_sfzh\">([0-9a-zA-Z]+)</span>");
            match = reg.Match(page);
            if (match.Value != "")
            {
                idcard = match.Value.Substring("<span id=\"lbl_sfzh\">".Length, match.Value.Length - "<span id=\"lbl_sfzh\">".Length - n);
            }
            rt.Add("idcard", idcard);

            string candidates = "";

            reg   = new Regex("<span id=\"lbl_ksh\">([0-9]+)</span>");
            match = reg.Match(page);
            if (match.Value != "")
            {
                candidates = match.Value.Substring("<span id=\"lbl_ksh\">".Length, match.Value.Length - "<span id=\"lbl_ksh\">".Length - n);
            }
            rt.Add("candidates", candidates);

            return(rt);
        }