Exemplo n.º 1
0
 private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
 {
     try
     {
         SupremeSize          = webBrowser1.Document.GetElementById("size");
         SupremeAddButton     = webBrowser1.Document.GetElementById("add-remove-buttons");
         SupremeCart          = webBrowser1.Document.GetElementById("cart");
         SupremeCartAddress   = webBrowser1.Document.GetElementById("cart-address");
         SupremeState         = webBrowser1.Document.GetElementById("order_billing_state");
         SupremeCountry       = (mshtml.HTMLSelectElement)webBrowser1.Document.GetElementById("order_billing_country").DomElement;
         SupremeCartCC        = webBrowser1.Document.GetElementById("cart-cc");
         SupremeType          = webBrowser1.Document.GetElementById("credit_card_type");
         SupremeMonth         = webBrowser1.Document.GetElementById("credit_card_month");
         SupremeYear          = webBrowser1.Document.GetElementById("credit_card_year");
         SupremeTerm          = webBrowser1.Document.GetElementsByTagName("div");
         SupremeProcessButton = webBrowser1.Document.GetElementById("pay");
     }
     catch (Exception) { }
 }
Exemplo n.º 2
0
        private void button4_Click(object sender, EventArgs e)
        {
            try
            {
                document = webBrowser1.Document;

                formElement = document.GetElementById("form1");
                form = (mshtml.HTMLFormElement)formElement.DomElement;

                deptElement = document.GetElementById("ddl_depart");
                deptSelector = (mshtml.HTMLSelectElement)(deptElement.DomElement);

                personElement = document.GetElementById("ddl_person");
                personSelector = (mshtml.HTMLSelectElement)(personElement.DomElement);

                btnElement = document.GetElementById("btn_Query");
                btn = (mshtml.HTMLInputElement)(btnElement.DomElement);

                deptElement = document.GetElementById("ddl_depart");
                deptSelector = (mshtml.HTMLSelectElement)(deptElement.DomElement);

                formElement = document.GetElementById("form1");
                form = (mshtml.HTMLFormElement)formElement.DomElement;

                deptSelector.selectedIndex = 0;
                deptSelector.FireEvent("onchange");
                form.submit();

                personElement = document.GetElementById("ddl_person");
                personSelector = (mshtml.HTMLSelectElement)(personElement.DomElement);

                personSelector.selectedIndex = 0;

                //Application.DoEvents();

            }
            catch { }
        }
Exemplo n.º 3
0
        private void button3_Click(object sender, EventArgs e)
        {
            ///统计结束前所有操作键不可用
            this.button3.Enabled = false;
            this.button4.Enabled = false;
            this.button1.Enabled = false;
            this.button2.Enabled = false;

            int TotalClerksCount = 0;
            int TotalDeptCount = 0;

            try
            {
                document = webBrowser1.Document;

                formElement = document.GetElementById("form1");
                form = (mshtml.HTMLFormElement)formElement.DomElement;

                deptElement = document.GetElementById("ddl_depart");
                deptSelector = (mshtml.HTMLSelectElement)(deptElement.DomElement);

                personElement = document.GetElementById("ddl_person");
                personSelector = (mshtml.HTMLSelectElement)(personElement.DomElement);

                btnElement = document.GetElementById("btn_Query");
                btn = (mshtml.HTMLInputElement)(btnElement.DomElement);

                deptStringList = deptElement.OuterText.Split(new char[] { '—', ' ' })
                        .Where(p => p != string.Empty).Select(p => p.Trim()).ToList();

                TotalDeptCount = deptStringList.Count;
                textBox1.Text = TotalDeptCount.ToString();

                List<string> lastPersonStringList = new List<string>();

                int currentDeptIndex = deptSelector.selectedIndex;
                for (int i = (currentDeptIndex == 0 ? currentDeptIndex : currentDeptIndex - 1); i < deptStringList.Count; i++)
                {
                    bool IFailed = true;
                    int IFailedCount = 0;

                    while (IFailed)
                    {
                        try
                        {
                            if (WinFormClose)
                            {
                                break;
                            }

                            deptElement = document.GetElementById("ddl_depart");
                            deptSelector = (mshtml.HTMLSelectElement)(deptElement.DomElement);

                            formElement = document.GetElementById("form1");
                            form = (mshtml.HTMLFormElement)formElement.DomElement;

                            deptSelector.selectedIndex = i + 1;
                            deptSelector.FireEvent("onchange");
                            form.submit();

                            System.Threading.Thread.Sleep(300);
                            Application.DoEvents();

                            personElement = document.GetElementById("ddl_person");
                            personSelector = (mshtml.HTMLSelectElement)(personElement.DomElement);

                            var tempPersonStringList = personElement.OuterText.Split(new char[] { '—', ' ' })
                                .Where(p => p != string.Empty).Select(p => p.Trim()).ToList();

                            personStringList = new List<string>();
                            //get current dept persons
                            for (int j = 0; j < tempPersonStringList.Count; j++)
                            {
                                if (j % 2 == 1) personStringList.Add(tempPersonStringList[j]);
                            }

                            if (lastPersonStringList.Count == personStringList.Count)
                            {
                                if (lastPersonStringList.Count > 0)
                                {
                                    if (lastPersonStringList[0] == personStringList[0])
                                    {
                                        IFailed = true;
                                    }
                                    else
                                    {
                                        TotalClerksCount += personStringList.Count;

                                        IFailed = false;

                                        lastPersonStringList.Clear();
                                        foreach (string oneName in personStringList)
                                        {
                                            lastPersonStringList.Add(oneName);
                                        }
                                    }
                                }
                                else if (IFailedCount > 5)
                                {
                                    IFailed = false;
                                }
                                else if (lastPersonStringList.Count == 0)
                                {
                                    IFailed = false;
                                }
                            }
                            else
                            {
                                TotalClerksCount += personStringList.Count;
                                textBox2.Text = TotalClerksCount.ToString();

                                IFailed = false;

                                lastPersonStringList.Clear();
                                foreach (string oneName in personStringList)
                                {
                                    lastPersonStringList.Add(oneName);
                                }
                            }

                        }
                        catch (Exception ex)
                        {
                            Trace.TraceError(ex.Message);

                            IFailedCount++;

                            if (IFailedCount > 5)
                            {
                                System.Threading.Thread.Sleep(IFailedCount * 200);
                                Application.DoEvents();
                            }
                        }
                    }
                }
            }
            catch { }

            ///统计结束所有操作键可用
            this.button3.Enabled = true;
            this.button4.Enabled = true;
            this.button1.Enabled = true;
            this.button2.Enabled = true;
        }
        private void FireSelElementEvent(mshtml.HTMLSelectElement selElement, string strEvent)
        {
            object sender = selElement as object;

            selElement.FireEvent(strEvent, ref sender);
        }
Exemplo n.º 5
0
        void AI()
        {
            HtmlAgilityPack.HtmlDocument Doc = null;
            HtmlAgilityPack.HtmlDocument Tmp = null;

            List <int> Items          = Enumerable.Range(0, Proposal.Count).ToList();
            List <int> PurchasedItems = new List <int>();

            while (Heartbeat)
            {
                foreach (int Item in Items.Reverse <int>())
                {
                    #region Artificial Intelligence

                    try
                    {
                        #region Propsal & Supreme - Tag value verifiction comparer navigator

                        SupremeList List = null;

                        if (!string.IsNullOrEmpty(Proposal[Item].Tag))
                        {
                            List = new SupremeList(0);

                            if (!List.Executed)
                            {
                                continue;
                            }

                            Doc = null;

                            for (int a = 0; a < List.Count; a++)
                            {
                                if (Compute(Proposal[Item].Tag, List[a].Name) < 4 || List[a].Name.Contains(Proposal[Item].Tag))
                                {
                                    Doc = new HtmlAgilityPack.HtmlDocument();
                                    Doc.LoadHtml(new WebClient().DownloadString("http://www.supremenewyork.com" + List[a].Href));

                                    Form1.webBrowser1.Navigate(new Uri("about:blank"));
                                    Form1.webBrowser1.Navigate("http://www.supremenewyork.com" + List[a].Href);

                                    break;
                                }
                            }

                            if (Doc == null)
                            {
                                continue;
                            }
                        }

                        #endregion

                        #region Propsal & Supreme - Design value verification comparer navigator

                        SupremeList Design = null;

                        if (!string.IsNullOrEmpty(Proposal[Item].Design))
                        {
                            Design = new SupremeList(Doc.DocumentNode.SelectNodes("//div[@id='details'] //li"));

                            if (!Design.Executed)
                            {
                                continue;
                            }

                            Tmp = null;

                            for (int s = 0; s < Design.Count; s++)
                            {
                                if (Compute(Proposal[Item].Design, Design[s].Design) < 1 || Design[s].Design.Contains(Proposal[Item].Design))
                                {
                                    if (!Design[s].Sold)
                                    {
                                        Tmp = new HtmlAgilityPack.HtmlDocument();
                                        Tmp.LoadHtml(new WebClient().DownloadString("http://www.supremenewyork.com" + Design[s].Href));

                                        Form1.webBrowser1.Navigate(new Uri("about:blank"));
                                        Form1.webBrowser1.Navigate("http://www.supremenewyork.com" + Design[s].Href);

                                        break;
                                    }
                                }
                            }

                            if (Tmp == null)
                            {
                                continue;
                            }
                        }

                        #endregion

                        Thread.Sleep(3000);

                        #region Proposal & Supreme - Size value verification event

                        #region List value event

                        System.Windows.Forms.HtmlElement SupremeSize = null;

                        if (!string.IsNullOrEmpty(Proposal[Item].Size))
                        {
                            SupremeSize = Form1.SupremeSize;

                            System.Windows.Forms.HtmlElementCollection Options = SupremeSize.Children;

                            foreach (System.Windows.Forms.HtmlElement element in Options)
                            {
                                if (Compute(Proposal[Item].Size, element.InnerText) < 1)
                                {
                                    SupremeSize.SetAttribute("value", GetSubstringByString("=", ">", element.OuterHtml));
                                    SupremeSize.InvokeMember("onchange");
                                    SupremeSize.InvokeMember("click");

                                    break;
                                }
                            }
                        }

                        #endregion

                        #endregion

                        Thread.Sleep(3000);

                        #region Supreme - Add to cart button event

                        #region Button event

                        System.Windows.Forms.HtmlElement SupremeAddButton = null;

                        SupremeAddButton = Form1.SupremeAddButton;

                        System.Windows.Forms.HtmlElementCollection AddButton = SupremeAddButton.Children;

                        foreach (System.Windows.Forms.HtmlElement element in AddButton)
                        {
                            if (element.GetAttribute("value").Equals("add to cart"))
                            {
                                element.InvokeMember("submit");
                                element.InvokeMember("click");

                                break;
                            }
                        }

                        #endregion

                        #endregion

                        Thread.Sleep(3000);

                        Form1.webBrowser1.Navigate("https://www.supremenewyork.com/checkout");

                        Thread.Sleep(3000);

                        #region Supreme - Billing/Shipping information event

                        #region Textbox value event

                        System.Windows.Forms.HtmlElement SupremeCartAddress = null;

                        SupremeCartAddress = Form1.SupremeCartAddress;

                        SupremeCartAddress.Document.GetElementById("order_billing_name").SetAttribute("value", Information[0].Name);
                        SupremeCartAddress.Document.GetElementById("order_email").SetAttribute("value", Information[0].Email);
                        SupremeCartAddress.Document.GetElementById("order_tel").SetAttribute("value", Information[0].Tel);
                        SupremeCartAddress.Document.GetElementById("bo").SetAttribute("value", Information[0].Address);
                        SupremeCartAddress.Document.GetElementById("order_billing_zip").SetAttribute("value", Information[0].Zip);
                        SupremeCartAddress.Document.GetElementById("order_billing_city").SetAttribute("value", Information[0].City);

                        #endregion

                        #region List value event

                        mshtml.HTMLSelectElement SupremeCountry = null;

                        if (Information[0].Country != "USA")
                        {
                            SupremeCountry = Form1.SupremeCountry;

                            SupremeCountry.selectedIndex = 1;

                            SupremeCountry.click();

                            SupremeCountry.FireEvent("onchange");
                        }

                        // you can copy the format below to select any EUROPEAN country here...as of right now this code only works for the NORTH AMERICAN shipping

                        System.Windows.Forms.HtmlElement SupremeState = null;

                        SupremeState = Form1.SupremeState;

                        System.Windows.Forms.HtmlElementCollection State = SupremeState.Children;

                        foreach (System.Windows.Forms.HtmlElement element in State)
                        {
                            if (element.InnerText == Information[0].State)
                            {
                                SupremeState.SetAttribute("value", Information[0].State);
                                SupremeState.InvokeMember("onchange");
                                SupremeState.InvokeMember("click");

                                break;
                            }
                        }

                        #endregion

                        #endregion

                        Thread.Sleep(3000);

                        #region Supreme - Credit card information event

                        #region List value event

                        System.Windows.Forms.HtmlElement SupremeType = null;

                        SupremeType = Form1.SupremeType;

                        System.Windows.Forms.HtmlElementCollection Type = SupremeType.Children;

                        foreach (System.Windows.Forms.HtmlElement element in Type)
                        {
                            if (element.InnerText == Information[0].Type)
                            {
                                SupremeType.SetAttribute("value", FormatType(Information[0].Type));
                                SupremeType.InvokeMember("onchange");
                                SupremeType.InvokeMember("click");

                                break;
                            }
                        }

                        System.Windows.Forms.HtmlElement SupremeMonth = null;

                        SupremeMonth = Form1.SupremeMonth;

                        System.Windows.Forms.HtmlElementCollection Month = SupremeMonth.Children;

                        foreach (System.Windows.Forms.HtmlElement element in Month)
                        {
                            if (element.InnerText == Information[0].Expiry.Substring(0, 2))
                            {
                                SupremeMonth.SetAttribute("value", Information[0].Expiry.Substring(0, 2));
                                SupremeMonth.InvokeMember("onchange");
                                SupremeMonth.InvokeMember("click");

                                break;
                            }
                        }

                        System.Windows.Forms.HtmlElement SupremeYear = null;

                        SupremeYear = Form1.SupremeYear;

                        System.Windows.Forms.HtmlElementCollection Year = SupremeYear.Children;

                        foreach (System.Windows.Forms.HtmlElement element in Year)
                        {
                            if (element.InnerText == Information[0].Expiry.Substring(2, 5).Trim())
                            {
                                SupremeYear.SetAttribute("value", Information[0].Expiry.Substring(2, 5).Trim());
                                SupremeYear.InvokeMember("onchange");
                                SupremeYear.InvokeMember("click");

                                break;
                            }
                        }

                        #endregion

                        #region Textbox value event

                        System.Windows.Forms.HtmlElement SupremeCartCC = null;

                        SupremeCartCC = Form1.SupremeCartCC;

                        SupremeCartCC.Document.GetElementById("cnb").SetAttribute("value", Information[0].Number);
                        SupremeCartCC.Document.GetElementById("vval").SetAttribute("value", Information[0].Cvv);

                        #endregion

                        #region Checkbox event

                        System.Windows.Forms.HtmlElementCollection Term = null;

                        Term = Form1.SupremeTerm;

                        foreach (System.Windows.Forms.HtmlElement element in Term)
                        {
                            if (element.GetAttribute("className") == "icheckbox_minimal")
                            {
                                if (element.FirstChild.Id == "order_terms")
                                {
                                    element.SetAttribute("className", "icheckbox_minimal checked");

                                    break;
                                }
                            }
                        }

                        #endregion

                        #region Button event

                        System.Windows.Forms.HtmlElement SupremeProcessButton = null;

                        SupremeProcessButton = Form1.SupremeProcessButton;

                        System.Windows.Forms.HtmlElementCollection Pay = SupremeProcessButton.Children;

                        foreach (System.Windows.Forms.HtmlElement element in Pay)
                        {
                            if (element.GetAttribute("value").Equals("process payment"))
                            {
                                element.InvokeMember("click");

                                break;
                            }
                        }

                        #endregion

                        #endregion

                        Thread.Sleep(5000);

                        Form1.BotBuddha(2);

                        Thread.Sleep(3000);

                        PurchasedItems.Add(Item);

                        Items.Remove(Item);

                        if (PurchasedItems.Count != Proposal.Count)
                        {
                            Form1.BotBuddha(3);
                        }
                        else
                        {
                            Form1.BotBuddha(0);
                        }
                    }
                    catch (Exception) { }

                    #endregion
                }
            }
        }
Exemplo n.º 6
-2
        private void button1_Click(object sender, EventArgs e)
        {
            ///导出过程中导出键不可用
            this.button1.Enabled = false;
            ///导出过程中暂停键可用
            this.button2.Enabled = true;
            ///导出过程中统计键不可用
            this.button3.Enabled = false;
            this.button4.Enabled = false;

            ExtractPlaying = true;

            try
            {
                string currentPath = Application.StartupPath;

                string dataFile =  currentPath + "\\contacts.db";
                bool isExist = File.Exists(dataFile);
                dataFile = "Data Source='" + dataFile + "'";

                SQLiteConnection conn = new SQLiteConnection(dataFile + ";Pooling=true;FailIfMissing=false");
                conn.Open();
                var command = new SQLiteCommand(conn);

                if (!isExist)
                {
                    command.CommandText = @"CREATE TABLE [PERSON] (
            [ID] varchar NOT NULL PRIMARY KEY,
            [NAME] varchar,
            [DEPARTMENT] varchar,
            [MOBILE_PHONE] varchar,
            [VIRTUAL_PHONE] varchar,
            [POSITION] varchar,
            [REGION] varchar,
            [OFFICE_PHONE] varchar,
            [INNER_PHONE] varchar,
            [PY] varchar,
            [CAR] varchar
            )";
                    command.ExecuteNonQuery();
                }

                document = webBrowser1.Document;

                formElement = document.GetElementById("form1");
                form = (mshtml.HTMLFormElement)formElement.DomElement;

                deptElement = document.GetElementById("ddl_depart");
                deptSelector = (mshtml.HTMLSelectElement)(deptElement.DomElement);

                personElement = document.GetElementById("ddl_person");
                personSelector = (mshtml.HTMLSelectElement)(personElement.DomElement);

                btnElement = document.GetElementById("btn_Query");
                btn = (mshtml.HTMLInputElement)(btnElement.DomElement);

                deptStringList = deptElement.OuterText.Split(new char[] { '—', ' ' })
                        .Where(p => p != string.Empty).Select(p => p.Trim()).ToList();

                List<string> lastPersonStringList = new List<string>();

                int currentDeptIndex = deptSelector.selectedIndex;
                for (int i = (currentDeptIndex == 0 ? currentDeptIndex : currentDeptIndex - 1); i < deptStringList.Count; i++)
                {
                    bool IFailed = true;
                    int IFailedCount = 0;

                    while (IFailed && ExtractPlaying)
                    {
                        try
                        {
                            if (WinFormClose)
                            {
                                break;
                            }

                            bool LoadSuccess = true;

                            deptElement = document.GetElementById("ddl_depart");
                            deptSelector = (mshtml.HTMLSelectElement)(deptElement.DomElement);

                            formElement = document.GetElementById("form1");
                            form = (mshtml.HTMLFormElement)formElement.DomElement;

                            deptSelector.selectedIndex = i + 1;
                            deptSelector.FireEvent("onchange");
                            form.submit();

                            System.Threading.Thread.Sleep(500);
                            Application.DoEvents();

                            personElement = document.GetElementById("ddl_person");
                            personSelector = (mshtml.HTMLSelectElement)(personElement.DomElement);

                            var tempPersonStringList = personElement.OuterText.Split(new char[] { '—', ' ' })
                                .Where(p => p != string.Empty).Select(p => p.Trim()).ToList();

                            personStringList = new List<string>();
                            //get current dept persons
                            for (int j = 0; j < tempPersonStringList.Count; j++)
                            {
                                if (j % 2 == 1) personStringList.Add(tempPersonStringList[j]);
                            }

                            if (lastPersonStringList.Count == personStringList.Count)
                            {
                                if (lastPersonStringList.Count > 0)
                                {
                                    if (lastPersonStringList[0] == personStringList[0])
                                    {
                                        LoadSuccess = false;
                                    }
                                    else
                                    {

                                        lastPersonStringList.Clear();
                                        foreach (string oneName in personStringList)
                                        {
                                            lastPersonStringList.Add(oneName);
                                        }
                                    }
                                }
                                else
                                {
                                    if (IFailedCount < 5)
                                    {
                                        LoadSuccess = false;
                                        IFailedCount++;
                                    }
                                    else if (lastPersonStringList.Count == 0)
                                    {
                                        IFailed = false;
                                    }
                                }
                            }
                            else
                            {

                                lastPersonStringList.Clear();
                                foreach (string oneName in personStringList)
                                {
                                    lastPersonStringList.Add(oneName);
                                }
                            }

                            if (LoadSuccess)
                            {
                                int currentPersonIndex = personSelector.selectedIndex;
                                for (int j = (currentPersonIndex == 0 ? currentPersonIndex : currentPersonIndex - 1); j < personStringList.Count; j++)
                                {
                                    bool JFailed = true;
                                    int JFailedCount = 0;

                                    while (JFailed && ExtractPlaying)
                                    {
                                        try
                                        {
                                            personElement = document.GetElementById("ddl_person");
                                            personSelector = (mshtml.HTMLSelectElement)(personElement.DomElement);

                                            personSelector.selectedIndex = j + 1;
                                            //personSelector.FireEvent("onchange");

                                            //记录下拉框的工号,用于对比判断下面信息是否刷新
                                            string CurrentSelectedID = personSelector.value;

                                            btnElement = document.GetElementById("btn_Query");
                                            btn = (mshtml.HTMLInputElement)(btnElement.DomElement);
                                            btn.click();

                                            System.Threading.Thread.Sleep(200);
                                            Application.DoEvents();

                                            formElement = document.GetElementById("form1");
                                            form = (mshtml.HTMLFormElement)formElement.DomElement;

                                            var tableElement = formElement.GetElementsByTagName("table")[1];
                                            var table = (mshtml.HTMLTable)tableElement.DomElement;

                                            var cells = table.cells.Cast<mshtml.HTMLTableCell>().ToList();

                                            string id = cells[1].innerText.Trim();
                                            if (CurrentSelectedID == id)
                                            {
                                                string name = cells[3].innerText.Trim();
                                                string dept = cells[5].innerText.Trim();
                                                string mobile = cells[7].innerText.Trim();
                                                string virt = cells[9].innerText.Trim();
                                                string position = cells[11].innerText.Trim();
                                                string region = cells[13].innerText.Trim(new char[] { '区', '号', ' ' });
                                                string office = cells[14].innerText.Trim(new char[] { '电', '话', ' ' });
                                                string inner = cells[15].innerText.Trim(new char[] { '分', '机', ' ' });
                                                string car = cells[17].innerText.Trim();

                                                command.CommandText = "select count(*) from [PERSON] where [ID]='" + id + "'";

                                                var result = int.Parse(command.ExecuteScalar().ToString());
                                                if (result == 0)
                                                {
                                                    command.CommandText = string.Format(@"INSERT INTO [PERSON]
            ([ID]
            ,[NAME]
            ,[DEPARTMENT]
            ,[MOBILE_PHONE]
            ,[VIRTUAL_PHONE]
            ,[POSITION]
            ,[REGION]
            ,[OFFICE_PHONE]
            ,[INNER_PHONE]
            ,[PY]
            ,[CAR])
            VALUES
            ('{0}'
            ,'{1}'
            ,'{2}'
            ,'{3}'
            ,'{4}'
            ,'{5}'
            ,'{6}'
            ,'{7}'
            ,'{8}'
            ,'{9}'
            ,'{10}')", id, name, dept, mobile, virt, position, region, office, inner, ConvertHZToPY.ToChineseSpell(name), car);
                                                    command.ExecuteNonQuery();
                                                }
                                                else if (result > 0)
                                                {
                                                    command.CommandText = string.Format(@"UPDATE [PERSON]
            SET [ID] = '{0}'
            ,[NAME] = '{1}'
            ,[DEPARTMENT] ='{2}'
            ,[MOBILE_PHONE] = '{3}'
            ,[VIRTUAL_PHONE] ='{4}'
            ,[POSITION] = '{5}'
            ,[REGION] ='{6}'
            ,[OFFICE_PHONE] ='{7}'
            ,[INNER_PHONE] = '{8}'
            ,[PY]='{9}'
            ,[CAR]='{11}'
            WHERE [ID]='{10}'", id, name, dept, mobile, virt, position, region, office, inner, ConvertHZToPY.ToChineseSpell(name), id, car);
                                                    command.ExecuteNonQuery();
                                                }

                                                JFailed = false;
                                            }
                                            else
                                            {
                                                //如果下拉框和下面信息不一致,本次信息抓取失败,重新抓取
                                                JFailed = true;
                                                JFailedCount++;
                                            }

                                        }
                                        catch (Exception ex)
                                        {
                                            Trace.TraceError(ex.Message);

                                            JFailedCount++;

                                            if (JFailedCount > 5)
                                            {
                                                System.Threading.Thread.Sleep(JFailedCount * 200);
                                                Application.DoEvents();
                                            }
                                        }
                                    }

                                }

                                IFailed = false;
                            }
                        }
                        catch (Exception ex)
                        {
                            Trace.TraceError(ex.Message);

                            IFailedCount++;

                            if (IFailedCount > 5)
                            {
                                System.Threading.Thread.Sleep(IFailedCount * 200);
                                Application.DoEvents();
                            }
                        }
                    }
                }
                conn.Close();
            }
            catch
            {
                MessageBox.Show("认证失败,请重新打开本软件");
            }

            ///导出结束后导出键可用
            this.button1.Enabled = true;
            ///导出结束后暂停键不可用
            this.button2.Enabled = false;
            ///导出结束中统计键可用
            this.button3.Enabled = true;
            this.button4.Enabled = true;

            ExtractPlaying = false;

            MessageBox.Show("导出结束!");

            if (WinFormClose)
            {
                this.Close();
            }
        }