lk
2022-10-21 6a01d7eb50d4c351c0b050c628db7d7daf4e7a01
TI已经优化完成20221021LK
4个文件已修改
418 ■■■■■ 已修改文件
BankRobot/Program.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
BankRobot/app.config 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BankRobot/frmCollectTI.Designer.cs 88 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BankRobot/frmCollectTI.cs 325 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BankRobot/Program.cs
@@ -17,7 +17,7 @@
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new frmCollectWX());
            Application.Run(new frmCollectTI());
        }
    }
}
BankRobot/app.config
@@ -76,5 +76,8 @@
    <!--支付截图位置-->
    <add key="iLeft" value="670" />
    <add key="iTop" value="235" />
    <!--判断是否缺货位置-->
    <add key="OutofstockLeft" value="670" />
    <add key="OutofstockTop" value="235" />
  </appSettings>
</configuration>
BankRobot/frmCollectTI.Designer.cs
@@ -34,13 +34,16 @@
            this.btnStart = new System.Windows.Forms.Button();
            this.timer1 = new System.Windows.Forms.Timer(this.components);
            this.richTextLog = new System.Windows.Forms.RichTextBox();
            this.lblStatus = new System.Windows.Forms.Label();
            this.txtURL = new System.Windows.Forms.TextBox();
            this.btnStop = new System.Windows.Forms.Button();
            this.btnContinue = new System.Windows.Forms.Button();
            this.txtquantity = new System.Windows.Forms.TextBox();
            this.label1 = new System.Windows.Forms.Label();
            this.label2 = new System.Windows.Forms.Label();
            this.label3 = new System.Windows.Forms.Label();
            this.txtproduct = new System.Windows.Forms.TextBox();
            this.btnrepeat = new System.Windows.Forms.Button();
            this.lblStatus = new System.Windows.Forms.Label();
            this.SuspendLayout();
            // 
            // btnTest
@@ -65,12 +68,12 @@
            // 
            // btnStart
            // 
            this.btnStart.Location = new System.Drawing.Point(659, 14);
            this.btnStart.Location = new System.Drawing.Point(663, 10);
            this.btnStart.Margin = new System.Windows.Forms.Padding(4);
            this.btnStart.Name = "btnStart";
            this.btnStart.Size = new System.Drawing.Size(75, 29);
            this.btnStart.Size = new System.Drawing.Size(110, 42);
            this.btnStart.TabIndex = 21;
            this.btnStart.Text = "启动";
            this.btnStart.Text = "启动有存货的";
            this.btnStart.UseVisualStyleBackColor = true;
            this.btnStart.Click += new System.EventHandler(this.btnStart_Click);
            // 
@@ -78,35 +81,26 @@
            // 
            this.richTextLog.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) 
            | System.Windows.Forms.AnchorStyles.Right)));
            this.richTextLog.Location = new System.Drawing.Point(22, 74);
            this.richTextLog.Location = new System.Drawing.Point(22, 118);
            this.richTextLog.Margin = new System.Windows.Forms.Padding(4);
            this.richTextLog.Name = "richTextLog";
            this.richTextLog.Size = new System.Drawing.Size(1028, 411);
            this.richTextLog.Size = new System.Drawing.Size(1028, 324);
            this.richTextLog.TabIndex = 26;
            this.richTextLog.Text = "";
            // 
            // lblStatus
            //
            this.lblStatus.AutoSize = true;
            this.lblStatus.Location = new System.Drawing.Point(19, 49);
            this.lblStatus.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
            this.lblStatus.Name = "lblStatus";
            this.lblStatus.Size = new System.Drawing.Size(127, 15);
            this.lblStatus.TabIndex = 25;
            this.lblStatus.Text = "系统初始化完成!";
            //
            // txtURL
            // 
            this.txtURL.Location = new System.Drawing.Point(75, 18);
            this.txtURL.Location = new System.Drawing.Point(176, 18);
            this.txtURL.Margin = new System.Windows.Forms.Padding(4);
            this.txtURL.Name = "txtURL";
            this.txtURL.Size = new System.Drawing.Size(420, 25);
            this.txtURL.Size = new System.Drawing.Size(283, 25);
            this.txtURL.TabIndex = 23;
            this.txtURL.Text = "txs0104ed";
            // 
            // btnStop
            // 
            this.btnStop.Enabled = false;
            this.btnStop.Location = new System.Drawing.Point(834, 16);
            this.btnStop.Location = new System.Drawing.Point(878, 10);
            this.btnStop.Margin = new System.Windows.Forms.Padding(4);
            this.btnStop.Name = "btnStop";
            this.btnStop.Size = new System.Drawing.Size(73, 29);
@@ -118,7 +112,7 @@
            // btnContinue
            // 
            this.btnContinue.Enabled = false;
            this.btnContinue.Location = new System.Drawing.Point(751, 16);
            this.btnContinue.Location = new System.Drawing.Point(795, 10);
            this.btnContinue.Margin = new System.Windows.Forms.Padding(4);
            this.btnContinue.Name = "btnContinue";
            this.btnContinue.Size = new System.Drawing.Size(75, 29);
@@ -132,6 +126,7 @@
            this.txtquantity.Name = "txtquantity";
            this.txtquantity.Size = new System.Drawing.Size(56, 25);
            this.txtquantity.TabIndex = 32;
            this.txtquantity.Text = "10";
            // 
            // label1
            // 
@@ -145,17 +140,59 @@
            // label2
            // 
            this.label2.AutoSize = true;
            this.label2.Location = new System.Drawing.Point(1, 28);
            this.label2.Location = new System.Drawing.Point(28, 26);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(67, 15);
            this.label2.Size = new System.Drawing.Size(142, 15);
            this.label2.TabIndex = 34;
            this.label2.Text = "产品名称";
            this.label2.Text = "有存货的产品名称:";
            //
            // label3
            //
            this.label3.AutoSize = true;
            this.label3.Location = new System.Drawing.Point(43, 65);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(127, 15);
            this.label3.TabIndex = 35;
            this.label3.Text = "缺货的产品名称:";
            //
            // txtproduct
            //
            this.txtproduct.Location = new System.Drawing.Point(176, 57);
            this.txtproduct.Margin = new System.Windows.Forms.Padding(4);
            this.txtproduct.Name = "txtproduct";
            this.txtproduct.Size = new System.Drawing.Size(283, 25);
            this.txtproduct.TabIndex = 36;
            this.txtproduct.Text = "ISO5452DWR";
            //
            // btnrepeat
            //
            this.btnrepeat.Location = new System.Drawing.Point(663, 60);
            this.btnrepeat.Margin = new System.Windows.Forms.Padding(4);
            this.btnrepeat.Name = "btnrepeat";
            this.btnrepeat.Size = new System.Drawing.Size(110, 41);
            this.btnrepeat.TabIndex = 37;
            this.btnrepeat.Text = "启动缺货的";
            this.btnrepeat.UseVisualStyleBackColor = true;
            this.btnrepeat.Click += new System.EventHandler(this.repeat_Click);
            //
            // lblStatus
            //
            this.lblStatus.AutoSize = true;
            this.lblStatus.Location = new System.Drawing.Point(500, 65);
            this.lblStatus.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
            this.lblStatus.Name = "lblStatus";
            this.lblStatus.Size = new System.Drawing.Size(127, 15);
            this.lblStatus.TabIndex = 25;
            this.lblStatus.Text = "系统初始化完成!";
            // 
            // frmCollectTI
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(1079, 516);
            this.Controls.Add(this.btnrepeat);
            this.Controls.Add(this.txtproduct);
            this.Controls.Add(this.label3);
            this.Controls.Add(this.label2);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.txtquantity);
@@ -182,12 +219,15 @@
        private System.Windows.Forms.Button btnStart;
        private System.Windows.Forms.Timer timer1;
        private System.Windows.Forms.RichTextBox richTextLog;
        private System.Windows.Forms.Label lblStatus;
        private System.Windows.Forms.TextBox txtURL;
        private System.Windows.Forms.Button btnStop;
        private System.Windows.Forms.Button btnContinue;
        private System.Windows.Forms.TextBox txtquantity;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.Label label3;
        private System.Windows.Forms.TextBox txtproduct;
        private System.Windows.Forms.Button btnrepeat;
        private System.Windows.Forms.Label lblStatus;
    }
}
BankRobot/frmCollectTI.cs
@@ -98,7 +98,7 @@
        private void btnStart_Click(object sender, EventArgs e)
        {
            //启动
            Start();
            StartCommit();
            //try
            //{
            //    解析获取具体链接
@@ -191,137 +191,146 @@
        //}
        private void Start()
        private void StartCommit()
        {
            ////刷新
            //int refreshLeft = Convert.ToInt32(ConfigurationManager.AppSettings["refreshLeft"]);
            //int refreshTop = Convert.ToInt32(ConfigurationManager.AppSettings["refreshTop"]);
            //ClickButtonBy(refreshLeft, refreshTop);
            ////输入产品
            //int productLeft = Convert.ToInt32(ConfigurationManager.AppSettings["productLeft"]);
            //int productTop = Convert.ToInt32(ConfigurationManager.AppSettings["productTop"]);
            //if (txtURL.Text.Trim() != null)
            //{
            //    InputTextInfo(txtURL.Text.Trim(), productLeft, productTop);
            //}
            //else
            //{
            //    MessageBox.Show("请输入产品");
            //}
            //string strURL = HttpUtility.UrlEncode(txtURL.Text, Encoding.UTF8);
            //DelayTime(2000);
            ////点击搜索产品
            //int searchproductLeft = Convert.ToInt32(ConfigurationManager.AppSettings["searchproductLeft"]);
            //int searchproductTop = Convert.ToInt32(ConfigurationManager.AppSettings["searchproductTop"]);
            //ClickButtonBy(searchproductLeft, searchproductTop);
            //DelayTime(7000);
            ////指定位置输入购买数量
            //int purchasequantityLeft = Convert.ToInt32(ConfigurationManager.AppSettings["purchasequantityLeft"]);
            //int purchasequantityTop = Convert.ToInt32(ConfigurationManager.AppSettings["purchasequantityTop"]);
            //if (txtquantity.Text.Trim() != null)
            //{
            //    InputTextInfo(txtquantity.Text.Trim(), purchasequantityLeft, purchasequantityTop);
            //    DelayTime(2000);
            //}
            //else
            //{
            //    MessageBox.Show("请输入购买产品的数量");
            //}
            ////点击加入购物车
            //int shoppingcartLeft = Convert.ToInt32(ConfigurationManager.AppSettings["shoppingcartLeft"]);
            //int shoppingcartTop = Convert.ToInt32(ConfigurationManager.AppSettings["shoppingcartTop"]);
            //ClickButtonBy(shoppingcartLeft, shoppingcartTop);
            //DelayTime(7000);
            ////点击结算按钮
            //int settlementLeft = Convert.ToInt32(ConfigurationManager.AppSettings["settlementLeft"]);
            //int settlementTop = Convert.ToInt32(ConfigurationManager.AppSettings["settlementTop"]);
            //ClickButtonBy(settlementLeft, settlementTop);
            //DelayTime(10000);
            ////点击购物车里结算按钮
            //int settlementtwoLeft = Convert.ToInt32(ConfigurationManager.AppSettings["settlementtwoLeft"]);
            //int settlementtwoTop = Convert.ToInt32(ConfigurationManager.AppSettings["settlementtwoTop"]);
            //ClickButtonBy(settlementtwoLeft, settlementtwoTop);
            //DelayTime(10000);
            ////点击2次下滑,再点击(1)下一步
            int slidedownwardLeft = Convert.ToInt32(ConfigurationManager.AppSettings["slidedownwardLeft"]);
            int slidedownwardTop = Convert.ToInt32(ConfigurationManager.AppSettings["slidedownwardTop"]);
            //ClickButtonBy(slidedownwardLeft, slidedownwardTop);
            //ClickButtonBy(slidedownwardLeft, slidedownwardTop);
            //DelayTime(2000);
            //int nextstepLeft = Convert.ToInt32(ConfigurationManager.AppSettings["nextstepLeft"]);
            //int nextstepTop = Convert.ToInt32(ConfigurationManager.AppSettings["nextstepTop"]);
            //ClickButtonBy(nextstepLeft, nextstepTop);
            //DelayTime(15000);
            ////2.先点击必选框,再一次点击下滑,最后点击(2)下一步
            //int mandatoryLeft = Convert.ToInt32(ConfigurationManager.AppSettings["mandatoryLeft"]);
            //int mandatoryTop = Convert.ToInt32(ConfigurationManager.AppSettings["mandatoryTop"]);
            //ClickButtonBy(mandatoryLeft, mandatoryTop);
            //DelayTime(1000);
            //ClickButtonBy(slidedownwardLeft, slidedownwardTop);
            //int nextsteptwoLeft = Convert.ToInt32(ConfigurationManager.AppSettings["nextsteptwoLeft"]);
            //int nextsteptwoTop = Convert.ToInt32(ConfigurationManager.AppSettings["nextsteptwoTop"]);
            //ClickButtonBy(nextsteptwoLeft, nextsteptwoTop);
            ////点击确认并继续
            //int determineLeft = Convert.ToInt32(ConfigurationManager.AppSettings["determineLeft"]);
            //int determineTop = Convert.ToInt32(ConfigurationManager.AppSettings["determineTop"]);
            //ClickButtonBy(determineLeft, determineTop);
            //DelayTime(20000);
            ////3.先点击下滑再点击(3)下一步
            //ClickButtonBy(slidedownwardLeft, slidedownwardTop);
            //int nextstepthreeLeft = Convert.ToInt32(ConfigurationManager.AppSettings["nextstepthreeLeft"]);
            //int nextstepthreeTop = Convert.ToInt32(ConfigurationManager.AppSettings["nextstepthreeTop"]);
            //ClickButtonBy(nextstepthreeLeft, nextstepthreeTop);
            //DelayTime(15000);
            //4.第4步没有
            //5.先点击下滑再点击服务条款阅读,再点击接受,点击下滑,最后点击(4)下一步
            //ClickButtonBy(slidedownwardLeft, slidedownwardTop);
            //int serviceLeft = Convert.ToInt32(ConfigurationManager.AppSettings["serviceLeft"]);
            //int serviceTop = Convert.ToInt32(ConfigurationManager.AppSettings["serviceTop"]);
            //ClickButtonBy(serviceLeft, serviceTop);
            //int acceptLeft = Convert.ToInt32(ConfigurationManager.AppSettings["acceptLeft"]);
            //int acceptTop = Convert.ToInt32(ConfigurationManager.AppSettings["acceptTop"]);
            //ClickButtonBy(acceptLeft, acceptTop);
            //DelayTime(1000);
            //ClickButtonBy(slidedownwardLeft, slidedownwardTop);
            //int nextstepfourLeft = Convert.ToInt32(ConfigurationManager.AppSettings["nextstepfourLeft"]);
            //int nextstepfourTop = Convert.ToInt32(ConfigurationManager.AppSettings["nextstepfourTop"]);
            //ClickButtonBy(nextstepfourLeft, nextstepfourTop);
            //DelayTime(15000);
            ////6.先点击下滑,在选择支付宝或者微信支付,最后点击支付
            ////下滑
            //DelayTime(3000);
            //ClickButtonBy(slidedownwardLeft, slidedownwardTop);
            ////选择支付宝付款
            //int alipayLeft = Convert.ToInt32(ConfigurationManager.AppSettings["alipayLeft"]);
            //int alipayTop = Convert.ToInt32(ConfigurationManager.AppSettings["alipayTop"]);
            //ClickButtonBy(alipayLeft, alipayTop);
            ////选择微信支付
            //int weChatLeft = Convert.ToInt32(ConfigurationManager.AppSettings["weChatLeft"]);
            //int weChatTop = Convert.ToInt32(ConfigurationManager.AppSettings["weChatTop"]);
            //ClickButtonBy(weChatLeft, weChatTop);
            //DelayTime(1000);
            //ClickButtonBy(slidedownwardLeft, slidedownwardTop);
            ////点击支付
            //int paymentLeft = Convert.ToInt32(ConfigurationManager.AppSettings["paymentLeft"]);
            //int paymentTop = Convert.ToInt32(ConfigurationManager.AppSettings["paymentTop"]);
            //ClickButtonBy(paymentLeft, paymentTop);
            //DelayTime(10000);
            int iLeft = Convert.ToInt32(ConfigurationManager.AppSettings["iLeft"]);
            int iTop = Convert.ToInt32(ConfigurationManager.AppSettings["iTop"]);
            string Base64Pic = ScreenVerifyCode(iLeft, iTop);
            string Result = GetNumbers.GeneralBasic(Base64Pic);
            JObject jo = new JObject();
            jo = JsonConvert.DeserializeObject<JObject>(Result);
            if (jo["words_result"] != null && jo["words_result"].ToString() != "")
            try
            {
                JObject words = jo["words_result"][0].Value<JObject>();
                richTextLog.Text += words["words"].ToString();
                MessageBox.Show("已成功完成订单,请支付");
                //刷新
                int refreshLeft = Convert.ToInt32(ConfigurationManager.AppSettings["refreshLeft"]);
                int refreshTop = Convert.ToInt32(ConfigurationManager.AppSettings["refreshTop"]);
                ClickButtonBy(refreshLeft, refreshTop);
                //输入产品
                int productLeft = Convert.ToInt32(ConfigurationManager.AppSettings["productLeft"]);
                int productTop = Convert.ToInt32(ConfigurationManager.AppSettings["productTop"]);
                if (txtURL.Text.Trim() != null)
                {
                    InputTextInfo(txtURL.Text.Trim(), productLeft, productTop);
                }
                else
                {
                    MessageBox.Show("请输入产品");
                }
                string strURL = HttpUtility.UrlEncode(txtURL.Text, Encoding.UTF8);
                DelayTime(3000);
                //点击搜索产品
                int searchproductLeft = Convert.ToInt32(ConfigurationManager.AppSettings["searchproductLeft"]);
                int searchproductTop = Convert.ToInt32(ConfigurationManager.AppSettings["searchproductTop"]);
                ClickButtonBy(searchproductLeft, searchproductTop);
                DelayTime(10000);
                //指定位置输入购买数量
                int purchasequantityLeft = Convert.ToInt32(ConfigurationManager.AppSettings["purchasequantityLeft"]);
                int purchasequantityTop = Convert.ToInt32(ConfigurationManager.AppSettings["purchasequantityTop"]);
                if (txtquantity.Text.Trim() != null)
                {
                    InputTextInfo(txtquantity.Text.Trim(), purchasequantityLeft, purchasequantityTop);
                    DelayTime(2000);
                }
                else
                {
                    MessageBox.Show("请输入购买产品的数量");
                }
                //点击加入购物车
                int shoppingcartLeft = Convert.ToInt32(ConfigurationManager.AppSettings["shoppingcartLeft"]);
                int shoppingcartTop = Convert.ToInt32(ConfigurationManager.AppSettings["shoppingcartTop"]);
                ClickButtonBy(shoppingcartLeft, shoppingcartTop);
                DelayTime(10000);
                //点击结算按钮
                int settlementLeft = Convert.ToInt32(ConfigurationManager.AppSettings["settlementLeft"]);
                int settlementTop = Convert.ToInt32(ConfigurationManager.AppSettings["settlementTop"]);
                ClickButtonBy(settlementLeft, settlementTop);
                DelayTime(12000);
                //点击购物车里结算按钮
                int settlementtwoLeft = Convert.ToInt32(ConfigurationManager.AppSettings["settlementtwoLeft"]);
                int settlementtwoTop = Convert.ToInt32(ConfigurationManager.AppSettings["settlementtwoTop"]);
                ClickButtonBy(settlementtwoLeft, settlementtwoTop);
                DelayTime(12000);
                //点击2次下滑,再点击(1)下一步
                int slidedownwardLeft = Convert.ToInt32(ConfigurationManager.AppSettings["slidedownwardLeft"]);
                int slidedownwardTop = Convert.ToInt32(ConfigurationManager.AppSettings["slidedownwardTop"]);
                ClickButtonBy(slidedownwardLeft, slidedownwardTop);
                ClickButtonBy(slidedownwardLeft, slidedownwardTop);
                DelayTime(2000);
                int nextstepLeft = Convert.ToInt32(ConfigurationManager.AppSettings["nextstepLeft"]);
                int nextstepTop = Convert.ToInt32(ConfigurationManager.AppSettings["nextstepTop"]);
                ClickButtonBy(nextstepLeft, nextstepTop);
                DelayTime(15000);
                //2.先点击必选框,再一次点击下滑,最后点击(2)下一步
                int mandatoryLeft = Convert.ToInt32(ConfigurationManager.AppSettings["mandatoryLeft"]);
                int mandatoryTop = Convert.ToInt32(ConfigurationManager.AppSettings["mandatoryTop"]);
                ClickButtonBy(mandatoryLeft, mandatoryTop);
                DelayTime(1000);
                ClickButtonBy(slidedownwardLeft, slidedownwardTop);
                int nextsteptwoLeft = Convert.ToInt32(ConfigurationManager.AppSettings["nextsteptwoLeft"]);
                int nextsteptwoTop = Convert.ToInt32(ConfigurationManager.AppSettings["nextsteptwoTop"]);
                ClickButtonBy(nextsteptwoLeft, nextsteptwoTop);
                //点击确认并继续
                int determineLeft = Convert.ToInt32(ConfigurationManager.AppSettings["determineLeft"]);
                int determineTop = Convert.ToInt32(ConfigurationManager.AppSettings["determineTop"]);
                ClickButtonBy(determineLeft, determineTop);
                DelayTime(20000);
                //3.先点击下滑再点击(3)下一步
                ClickButtonBy(slidedownwardLeft, slidedownwardTop);
                int nextstepthreeLeft = Convert.ToInt32(ConfigurationManager.AppSettings["nextstepthreeLeft"]);
                int nextstepthreeTop = Convert.ToInt32(ConfigurationManager.AppSettings["nextstepthreeTop"]);
                ClickButtonBy(nextstepthreeLeft, nextstepthreeTop);
                DelayTime(15000);
                //4.第4步没有
                //5.先点击下滑再点击服务条款阅读,再点击接受,点击下滑,最后点击(4)下一步
                ClickButtonBy(slidedownwardLeft, slidedownwardTop);
                int serviceLeft = Convert.ToInt32(ConfigurationManager.AppSettings["serviceLeft"]);
                int serviceTop = Convert.ToInt32(ConfigurationManager.AppSettings["serviceTop"]);
                ClickButtonBy(serviceLeft, serviceTop);
                int acceptLeft = Convert.ToInt32(ConfigurationManager.AppSettings["acceptLeft"]);
                int acceptTop = Convert.ToInt32(ConfigurationManager.AppSettings["acceptTop"]);
                ClickButtonBy(acceptLeft, acceptTop);
                DelayTime(1000);
                ClickButtonBy(slidedownwardLeft, slidedownwardTop);
                int nextstepfourLeft = Convert.ToInt32(ConfigurationManager.AppSettings["nextstepfourLeft"]);
                int nextstepfourTop = Convert.ToInt32(ConfigurationManager.AppSettings["nextstepfourTop"]);
                ClickButtonBy(nextstepfourLeft, nextstepfourTop);
                DelayTime(15000);
                //6.先点击下滑,再选择支付宝或者微信支付,最后点击支付
                //下滑
                DelayTime(3000);
                ClickButtonBy(slidedownwardLeft, slidedownwardTop);
                //选择支付宝付款
                int alipayLeft = Convert.ToInt32(ConfigurationManager.AppSettings["alipayLeft"]);
                int alipayTop = Convert.ToInt32(ConfigurationManager.AppSettings["alipayTop"]);
                ClickButtonBy(alipayLeft, alipayTop);
                //选择微信支付
                //int weChatLeft = Convert.ToInt32(ConfigurationManager.AppSettings["weChatLeft"]);
                //int weChatTop = Convert.ToInt32(ConfigurationManager.AppSettings["weChatTop"]);
                //ClickButtonBy(weChatLeft, weChatTop);
                DelayTime(1000);
                ClickButtonBy(slidedownwardLeft, slidedownwardTop);
                //点击支付
                int paymentLeft = Convert.ToInt32(ConfigurationManager.AppSettings["paymentLeft"]);
                int paymentTop = Convert.ToInt32(ConfigurationManager.AppSettings["paymentTop"]);
                ClickButtonBy(paymentLeft, paymentTop);
                DelayTime(10000);
                int iLeft = Convert.ToInt32(ConfigurationManager.AppSettings["iLeft"]);
                int iTop = Convert.ToInt32(ConfigurationManager.AppSettings["iTop"]);
                string Base64Pic = ScreenVerifyCode(iLeft, iTop);
                string Result = GetNumbers.GeneralBasic(Base64Pic);
                JObject jo = new JObject();
                jo = JsonConvert.DeserializeObject<JObject>(Result);
                if (jo["words_result"] != null && jo["words_result"].ToString() != "")
                {
                    JObject words = jo["words_result"][0].Value<JObject>();
                    richTextLog.Text += words["words"].ToString();
                    MessageBox.Show("已成功完成订单,请支付");
                }
                else
                {
                    MessageBox.Show("订单出现错误!");
                }
            }
            else
            catch (Exception)
            {
                MessageBox.Show("订单出现错误!");
                throw;
            }
        }
@@ -342,7 +351,7 @@
            gla.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
            gla.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
            gla.CopyFromScreen(iLeft, iTop, 0, 0, new Size(iWidth, iHeight));
            myImage.Save(System.AppDomain.CurrentDomain.BaseDirectory + "/ZFJT.png");
            myImage.Save(System.AppDomain.CurrentDomain.BaseDirectory + "/ZFZM.png");
            //字面是对当前图片进行了二进制转换
            MemoryStream ms = new MemoryStream();
            myImage.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
@@ -391,8 +400,25 @@
        private void btnStop_Click(object sender, EventArgs e)
        {
            //ResetSystem("系统自动抓取手动停止!");
            ResetSystem("系统自动抓取手动停止!");
        }
        /// <summary>
        /// 系统重新置位
        /// </summary>
        /// <param name="strInfo"></param>
        private void ResetSystem(string strInfo, bool bContinueFlag = false)
        {
            bStop = true;
            btnStart.Enabled = !bContinueFlag;
            btnContinue.Enabled = bContinueFlag;
            btnStop.Enabled = bContinueFlag;
            lblStatus.Text = strInfo;
            timer1.Enabled = false;
            iCount = 0;
            richTextLog.Text += DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + " ResetSystem系统重置!原因:" + strInfo + "\r\n";
        }
        /// <summary>
        /// 延迟函数防止假死
@@ -415,5 +441,46 @@
            }
            return;
        }
        private void repeat_Click(object sender, EventArgs e)
        {
            try
            {
                int i = 1;
                while (1 < 3)
                {
                    //刷新
                    int refreshLeft = Convert.ToInt32(ConfigurationManager.AppSettings["refreshLeft"]);
                    int refreshTop = Convert.ToInt32(ConfigurationManager.AppSettings["refreshTop"]);
                    ClickButtonBy(refreshLeft, refreshTop);
                    //输入产品
                    int productLeft = Convert.ToInt32(ConfigurationManager.AppSettings["productLeft"]);
                    int productTop = Convert.ToInt32(ConfigurationManager.AppSettings["productTop"]);
                    if (txtproduct.Text.Trim() != null)
                    {
                        InputTextInfo(txtproduct.Text.Trim(), productLeft, productTop);
                    }
                    else
                    {
                        MessageBox.Show("请输入产品");
                    }
                    string strURL = HttpUtility.UrlEncode(txtproduct.Text, Encoding.UTF8);
                    DelayTime(2000);
                    //点击搜索产品
                    int searchproductLeft = Convert.ToInt32(ConfigurationManager.AppSettings["searchproductLeft"]);
                    int searchproductTop = Convert.ToInt32(ConfigurationManager.AppSettings["searchproductTop"]);
                    ClickButtonBy(searchproductLeft, searchproductTop);
                    MessageBox.Show("因为没有库存所以会每10秒循坏1次,因为是演示,所以只循环三次,当前是第" + i + "次循环");
                    i++;
                    DelayTime(10000);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
    }
}