Beispiel #1
0
        public static bool PRAP_NewClaimSearch(SHDocVw.InternetExplorer wb, SHDocVw.ShellWindows shells, string Dcn)
        {
            if (wb != null)
            {
                mshtml.HTMLDocument iePrapDoc = wb.Document;

                mshtml.HTMLInputElement prapDCNinput = null;

                iePrapDoc.getElementById("advancedSearch").click();

                while (IELib.IEGet(shells, "Advanced Search") == null)
                {
                }

                wb = IELib.IEGet(shells, "Advanced Search");
                IELib.IeWait(wb);
                iePrapDoc = wb.Document;

                int timeOutCounter = 0;
                while (prapDCNinput == null)
                {
                    prapDCNinput = iePrapDoc.getElementsByName("documentControlNumber").item(0);
                    timeOutCounter++;
                    if (timeOutCounter == 50)
                    {
                        PRAP_Functions.PRAP_CloseWindows(shells); return(false);
                    }
                }

                try { prapDCNinput.value = "0201" + Dcn; } catch (Exception) { PRAP_Functions.PRAP_CloseWindows(shells); return(false); }

                try { iePrapDoc.getElementById("searchButn").click(); } catch (Exception) { PRAP_Functions.PRAP_CloseWindows(shells); return(false); }

                while (IELib.IEGet(shells, "Search Results") == null)
                {
                }

                wb        = IELib.IEGet(shells, "Search Results");
                iePrapDoc = wb.Document;
                foreach (mshtml.IHTMLElement a in iePrapDoc.getElementsByTagName("a"))
                {
                    if (a.innerText == "0201" + Dcn)
                    {
                        a.click();
                    }
                }

                while (IELib.IEGet(shells, "Claim Inquiry Details") == null)
                {
                }
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #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 { }
        }
Beispiel #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 FireInpElementEvent(mshtml.HTMLInputElement inpElement, string strEvent)
        {
            object sender = inpElement as object;

            inpElement.FireEvent(strEvent, ref sender);
        }
Beispiel #5
0
        public bool CheckStreamable(String url)
        {
            try
            {
                ie.Navigate2(url);
                //wb.ReadyState != WebBrowserReadyState.Complete
                while (ie.ReadyState != SHDocVw.tagREADYSTATE.READYSTATE_COMPLETE)
                {
                }
                mshtml.HTMLDocument vidpage = (mshtml.HTMLDocument)ie.Document;

                mshtml.HTMLInputElement vid = (mshtml.HTMLInputElement)vidpage.all.item("video-player-tag", 0);

                if (vid == null)
                {
                    intbroken++;
                    return(false);
                }
                else
                {
                    if (intsubview > 0)
                    {
                        mshtml.IHTMLElement views = vidpage.getElementById("visits");
                        string numviews           = views.innerText.ToLower().Replace("views", "").Trim();
                        int    intviews           = int.Parse(numviews);

                        if (intviews <= intsubview && !sublinks.Contains(url))
                        {
                            sublinks.Add(url);
                        }
                    }
                    Thread.Sleep(1000);
                    if (fullplay)
                    {
                        double dur     = vid.getAttribute("duration");
                        double curtime = vid.getAttribute("currentTime");
                        bool   past    = false;
                        while (curtime != dur && (curtime > .5 || !past))
                        {
                            if (!past && curtime > .5)
                            {
                                past = true;
                            }
                            curtime = vid.getAttribute("currentTime");
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                if (ex.Message.Equals("The remote server returned an error: (404) Not Found.") ||
                    ex.Message.Equals("The remote server returned an error: (500) Internal Server Error."))
                {
                    intbroken++;
                    return(false);
                }
                else
                {
                    throw ex;
                }
            }
            return(true);
        }
Beispiel #6
0
        public static bool Match(SelectorItem item, mshtml.IHTMLElement m)
        {
            foreach (var p in item.Properties.Where(x => x.Enabled == true && x.Value != null))
            {
                if (p.Name == "tagName")
                {
                    if (!string.IsNullOrEmpty(m.tagName))
                    {
                        var v = m.tagName;
                        if (!PatternMatcher.FitsMask(v, p.Value))
                        {
                            Log.Selector(p.Name + " mismatch '" + v + "' expected '" + p.Value + "'");
                            return(false);
                        }
                    }
                    else
                    {
                        Log.Selector(p.Name + " does not exists, but needed value '" + p.Value + "'");
                        return(false);
                    }
                }
                if (p.Name == "className")
                {
                    var v = m.className;

                    if (!string.IsNullOrEmpty(m.className))
                    {
                        if (v.Contains(" ") && !p.Value.Contains(" "))
                        {
                            var arr = v.Split(' '); var found = false;
                            foreach (var s in arr)
                            {
                                if (PatternMatcher.FitsMask(s, p.Value))
                                {
                                    found = true;
                                }
                            }
                            if (!found)
                            {
                                Log.Selector(p.Name + " mismatch '" + m.className + "' expected '" + p.Value + "'");
                                return(false);
                            }
                        }
                        else if (!PatternMatcher.FitsMask(v, p.Value))
                        {
                            Log.Selector(p.Name + " mismatch '" + m.className + "' expected '" + p.Value + "'");
                            return(false);
                        }
                    }
                    else
                    {
                        Log.Selector(p.Name + " does not exists, but needed value '" + p.Value + "'");
                        return(false);
                    }
                }
                if (p.Name == "type" && m.tagName.ToLower() == "input")
                {
                    mshtml.HTMLInputElement ele = (mshtml.HTMLInputElement)m;
                    if (!string.IsNullOrEmpty(ele.type))
                    {
                        var v = ele.type;
                        if (!PatternMatcher.FitsMask(ele.type, p.Value))
                        {
                            Log.Selector(p.Name + " mismatch '" + v + "' expected '" + p.Value + "'");
                            return(false);
                        }
                    }
                    else
                    {
                        Log.Selector(p.Name + " does not exists, but needed value '" + p.Value + "'");
                        return(false);
                    }
                }
                if (p.Name == "Id")
                {
                    if (!string.IsNullOrEmpty(m.id))
                    {
                        var v = m.id;
                        if (!PatternMatcher.FitsMask(m.id, p.Value))
                        {
                            Log.Selector(p.Name + " mismatch '" + v + "' expected '" + p.Value + "'");
                            return(false);
                        }
                    }
                    else
                    {
                        Log.Selector(p.Name + " does not exists, but needed value '" + p.Value + "'");
                        return(false);
                    }
                }
                if (p.Name == "IndexInParent")
                {
                    mshtml.IHTMLUniqueName id = m as mshtml.IHTMLUniqueName;
                    var uniqueID      = id.uniqueID;
                    var IndexInParent = -1;
                    if (m.parentElement != null && !string.IsNullOrEmpty(uniqueID))
                    {
                        mshtml.IHTMLElementCollection children = m.parentElement.children;
                        for (int i = 0; i < children.length; i++)
                        {
                            mshtml.IHTMLUniqueName id2 = children.item(i) as mshtml.IHTMLUniqueName;
                            if (id2.uniqueID == uniqueID)
                            {
                                IndexInParent = i; break;
                            }
                        }
                    }
                    if (IndexInParent != int.Parse(p.Value))
                    {
                        Log.Selector(p.Name + " mismatch '" + IndexInParent + "' expected '" + p.Value + "'");
                        return(false);
                    }
                }
            }
            return(true);
        }
Beispiel #7
0
        //印刷情報を取得する
        public bool GetFcwInfo(SHDocVw.InternetExplorerMedium cIe, string flName)
        {
            try
            {
                string Action;
                string fcw_formfile = "";
                string fcw_datafile = "";
                string url1         = "";
                string url2         = "";

                url2 = "";
                mshtml.HTMLFormElement form;
                mshtml.HTMLDocument    doc;
                doc = (mshtml.HTMLDocument)cIe.Document;
                mshtml.HTMLDocument tmdoc;
                tmdoc = (mshtml.HTMLDocument)doc.body.document;
                form  = (mshtml.HTMLFormElement)tmdoc.forms.item(0);
                mshtml.IHTMLElementCollection forms;
                forms  = (mshtml.IHTMLElementCollection)tmdoc.forms;
                form   = (mshtml.HTMLFormElement)forms.item(null, 0);
                Action = System.Convert.ToString(form.action);

                if (string.IsNullOrEmpty(Action))
                {
                    return(false);
                }

                mshtml.HTMLInputElement hid_fcw_formfile = default(mshtml.HTMLInputElement);
                hid_fcw_formfile = (mshtml.HTMLInputElement)(((mshtml.HTMLDocument)form.document).getElementsByName("fcw-formfile").item(0));
                fcw_formfile     = System.Convert.ToString(hid_fcw_formfile.value);

                mshtml.HTMLInputElement hid_fcw_datafile = default(mshtml.HTMLInputElement);
                hid_fcw_datafile = (mshtml.HTMLInputElement)(((mshtml.HTMLDocument)form.document).getElementsByName("fcw-datafile").item(0));
                fcw_datafile     = System.Convert.ToString(hid_fcw_datafile.value);

                url1 = form.action + "?fcw-driver=FCPC&fcw-formdownload=yes&fcw-newsession=yes&fcw-destination=client&fcw-overlay=3&fcw-endsession=yes&fcw-formfile=" + fcw_formfile + "&fcw-datafile=" + fcw_datafile;

                //Print 画面の情報取得
                object         bodyStr;
                string         bodyTxt   = "";
                MSXML2.XMLHTTP Retrieval = new MSXML2.XMLHTTP();
                Retrieval.open("Get", url1, false, "", "");
                Retrieval.send();
                bodyStr   = Retrieval.responseBody;
                bodyTxt   = System.Convert.ToString(Retrieval.responseText);
                Retrieval = null;

                //帳票のURL取得
                System.Text.RegularExpressions.Regex           reg = new System.Text.RegularExpressions.Regex("src=\"(?<src>[^\"]*)\"");
                System.Text.RegularExpressions.MatchCollection mc  = reg.Matches(bodyTxt);
                foreach (System.Text.RegularExpressions.Match m in mc)
                {
                    url2 = System.Convert.ToString(m.Value);
                }
                url2 = System.Convert.ToString(url2.Replace("src", "").Replace("\"", "").Replace("=http", "http"));
                reg  = null;

                if (System.IO.File.Exists(flName))
                {
                    FileSystem.Rename(flName.Replace(".csv", ".pdf"), flName.Replace(".csv", "_" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".bk.pdf"));
                }

                //帳票作成
                GetRemoteFiels(url2, flName.Replace(".csv", ".pdf"));

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
Beispiel #8
-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();
            }
        }