Ejemplo n.º 1
0
        /// <summary>
        /// #登陆之后每秒调用一次
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void yysj(object sender, EventArgs e)
        {
            //获取可以预约的时间
            string url  = "http://www.bjguahao.gov.cn/comm/plus/ajax_user.php?act=top_loginform";
            string html = HtmlHelp.sendGets(url, "http://www.bjguahao.gov.cn/comm/yyks-1.html");

            url  = "http://www.bjguahao.gov.cn/comm/content.php?hpid=" + hpid + "&keid=" + keid;
            html = HtmlHelp.sendGet(url, "http://www.bjguahao.gov.cn/comm/yyks-1.html");

            Utils         utils = new Utils(html);
            List <string> list  = utils.toYY();//获取可以预约时间的链接

            if (list.Count != 0)
            {
                textBox6.Text = "已经获取预约时间" + Environment.NewLine;
                yysjList      = list;
                timer1.Stop();
                yysjhou(url, hpid, keid);
                flg = false;
            }
            if (flg)//
            {
                textBox6.Text = strcount.ToString() + Environment.NewLine;
                strcount++;
            }
        }
Ejemplo n.º 2
0
        private void button2_Click(object sender, EventArgs e)
        {
            //确定预约

            string post = gh + "&dxcode=" + textBox4.Text + getsms(infohtml); //post发送的参数
            string html = HtmlHelp.sends("http://www.bjguahao.gov.cn/comm/" + hpName + "/ghdown.php", post, "POST", ghq);

            if (html.IndexOf("alert") == -1)
            {
                textBox5.Text += "购票成功" + Environment.NewLine + Environment.NewLine;
            }
            else
            {
                textBox5.Text += "购票失败" + Environment.NewLine + Environment.NewLine;
            }
            textBox5.Text += html + Environment.NewLine;

            //if (html.Length > 0)
            //{
            //    string url = "http://www.bjguahao.gov.cn/comm/show_cont.php";
            //    html = HtmlHelp.sendGet(url);
            //    Form3 f3 = new Form3(html);
            //    f3.ShowDialog();
            //}
        }
Ejemplo n.º 3
0
        public void land()
        {
            //登陆
            string post = string.Format("sfzhm={0}&truename={1}&yzm={2}", sfz, textBox1.Text, textBox3.Text);

            label3.Text     = HtmlHelp.send("http://www.bjguahao.gov.cn/comm/logon.php", post, "POST");
            timer1.Interval = Convert.ToInt32(textBoxTime.Text);
            timer1.Start();
            //yysj(new object(),EventArgs.Empty);
        }
Ejemplo n.º 4
0
 private void Form2_Load(object sender, EventArgs e)
 {
     System.Net.ServicePointManager.Expect100Continue = false;
     this.pictureBox1.Image = HtmlHelp.LoadCodeImg();
 }
Ejemplo n.º 5
0
        private void yysjhou(string urls, string hpid, string keid)
        {
            //获取可以预约医生的链接
            string urlt    = yysjList[0];
            string yyys    = HtmlHelp.sendGet(urlt, urls);
            int    startHp = yyys.LastIndexOf("<a href=") + 11;

            hpName = yyys.Substring(startHp);
            hpName = hpName.Substring(0, hpName.IndexOf("/"));
            Utils  utilsys = new Utils(yyys);
            Ysinfo ys      = utilsys.toYS(sx);//获取可以预约医生的链接

            if (ys == null)
            {
                label3.Text   += "没有可以预约的医生" + Environment.NewLine;
                textBox6.Text += "没有可以预约的医生" + Environment.NewLine;
            }
            else
            {
                label3.Text   += "预订挂号信息:" + Environment.NewLine + "职称:" + ys.zhicheng + Environment.NewLine + "专长:" + ys.zhuanchang + Environment.NewLine;
                textBox6.Text += "预订挂号信息:" + Environment.NewLine + "职称:" + ys.zhicheng + Environment.NewLine + "专长:" + ys.zhuanchang + Environment.NewLine;
            }

            string url      = @"http://www.bjguahao.gov.cn/comm" + ys.Url;
            string htmls    = HtmlHelp.sendGet(url, urlt);
            int    start    = htmls.IndexOf("/shortmsg/dx_code.php?");
            string newhtml  = htmls.Substring(start);
            int    newstart = newhtml.IndexOf(",");
            string text     = newhtml.Substring(0, newstart);

            text = text.Replace("\"", "");
            text = text.Replace("+hpid+", hpid);

            string ksid  = getparam(htmls, "code_ksid");
            string datid = getparam(htmls, "code_datid");


            int infoPostion = htmls.LastIndexOf("html>") + 5;

            infohtml = htmls.Substring(infoPostion);


            text = text.Replace("+ksid+", keid);
            text = text.Replace("+datid+", datid);
            text = text.Replace("+jiuz+", "");
            text = text.Replace("+ybkh+", "");
            text = text.Replace("+baoxiao", "0");
            text = text.Replace("+", "");
            text = @"http://www.bjguahao.gov.cn/comm" + text;
            //label3.Text += text;


            //发送短信验证码
            ghq = "hpid=" + hpid + "&ksid" + ksid + "&datid=" + datid;
            string ghreferer = @"http://www.bjguahao.gov.cn/comm/xiehe/guahao.php?" + ghq;

            gh = ghq + "&jiuz=&ybkh=" + sfz + "&baoxiao=1&tpost=3d4e81798b906881a05e122fbc5351c3";


            string valuesstr = HtmlHelp.sendGets(text, ghreferer);

            if (valuesstr.Length >= 1)
            {
                label3.Text += valuesstr + Environment.NewLine;
            }
        }