Example #1
0
        private void bckWorkerGetLinks_DoWork(object sender, DoWorkEventArgs e)
        {
            try
            {
                __RunningWorker = true;
                using (HTTP hTTP = new HTTP(__ScannerConf_.TimeOut, false))
                {
                    HTTP              arg_4A_0 = hTTP;
                    string            arg_4A_1 = __ScannerConf_.Url;
                    enHTTPMethod      arg_4A_2 = __ScannerConf_.Method;
                    string            text     = "";
                    object            arg_4A_4 = null;
                    NetworkCredential arg_4A_5 = null;
                    bool              arg_4A_6 = false;
                    string            text2    = "";
                    string            hTML     = arg_4A_0.GetHTML(arg_4A_1, arg_4A_2, ref text, arg_4A_4, arg_4A_5, arg_4A_6, ref text2);

                    if (!string.IsNullOrEmpty(hTML))
                    {
                        new List <ListViewItem>();
                        using (RegExp regExp = new RegExp())
                        {
                            try
                            {
                                IEnumerator enumerator = regExp.GetLinks(__ScannerConf_.Url, hTML, __ScannerConf_.RegExp).Values.GetEnumerator();
                                while (enumerator.MoveNext())
                                {
                                    Link link = (Link)enumerator.Current;
                                    if (string.IsNullOrEmpty(__ScannerConf_.Domain) || !Globals.G_Utilities.IsUrlValid(link.Url) || Strings.InStr(link.Url, __ScannerConf_.Domain, CompareMethod.Binary) != 0)
                                    {
                                        AddURL(link.Url, new string[0]);
                                    }
                                }
                            }
                            finally
                            {
                                IEnumerator enumerator = null;
                                if (enumerator is IDisposable)
                                {
                                    (enumerator as IDisposable).Dispose();
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception expr_11F)
            {
                ProjectData.SetProjectError(expr_11F);
                Exception ex = expr_11F;
                MessageBox.Show(ex.Message, "Please report this bug!", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                ProjectData.ClearProjectError();
            }
            finally
            {
            }
        }