Пример #1
0
 private void DoWork()
 {
     checked
     {
         try
         {
             if (this.__Dorks.Count <= this.__Threads)
             {
                 this.__Threads = this.__Dorks.Count;
             }
             this.__ThreadPool = new ThreadPool(this.__Threads);
             int count = this.__Dorks.Count;
             int num   = count - 1;
             for (int i = 0; i <= num; i++)
             {
                 if (this.ScannerStoped())
                 {
                     break;
                 }
                 this.Progress = (int)Math.Round(Math.Round((double)(100 * i) / (double)count));
                 SearchEngineUrls.Scanner_ProgressEventHandler scanner_ProgressEvent = this.Scanner_ProgressEvent;
                 if (scanner_ProgressEvent != null)
                 {
                     scanner_ProgressEvent(this.Progress, this.__Host);
                 }
                 Thread thread = new Thread(delegate(object a0)
                 {
                     this.ScannThread((SearchEngineUrls.ThreadScanner)a0);
                 });
                 thread.Start(new SearchEngineUrls.ThreadScanner
                 {
                     Thread = thread,
                     Dork   = this.__Dorks[i]
                 });
                 this.__ThreadPool.Open(thread);
                 this.__ThreadPool.WaitForThreads();
             }
         }
         catch (Exception expr_F0)
         {
             ProjectData.SetProjectError(expr_F0);
             ProjectData.ClearProjectError();
         }
         finally
         {
             this.__ThreadPool.AllJobsPushed();
             while (!this.ScannerStoped() && !this.__ThreadPool.Finished && this.__ThreadPool.ThreadCount != 0)
             {
             }
             this.__State  = SearchEngineUrls.Worker.Ide;
             this.Progress = 100;
             SearchEngineUrls.Scanner_DoneEventHandler scanner_DoneEvent = this.Scanner_DoneEvent;
             if (scanner_DoneEvent != null)
             {
                 scanner_DoneEvent(this.__Host);
             }
         }
     }
 }
Пример #2
0
 public SearchEngineUrls(SearchEngineUrls.Host h, int iRetry, int iTimeOut)
 {
     this.__Host    = h;
     this.__Retry   = iRetry;
     this.__TimeOut = iTimeOut;
     this.__State   = SearchEngineUrls.Worker.Ide;
     this.__Cookie  = new CookieCollection();
 }
Пример #3
0
 public void PauseScanning(bool state)
 {
     if (this.__State != SearchEngineUrls.Worker.Ide)
     {
         if (state)
         {
             this.__State = SearchEngineUrls.Worker.Paused;
         }
         else
         {
             this.__State = SearchEngineUrls.Worker.Working;
         }
     }
 }
Пример #4
0
        public void StartScanning(List <string> dorks, int threads, int delay)
        {
            if (this.__State != SearchEngineUrls.Worker.Ide)
            {
                MessageBox.Show("Scanner already running!");
                return;
            }
            if (dorks.Count <= threads)
            {
                threads = dorks.Count;
            }
            this.__ThreadPool     = new global::ThreadPool(threads);
            this.__BlackListProxy = new List <WebProxy>();
            this.Progress         = 0;
            this.LinksLoaded      = 0;
            this.__Delay          = delay;
            this.__Dorks          = dorks;
            this.__Threads        = threads;
            this.__State          = SearchEngineUrls.Worker.Working;
            Thread thread = new Thread(new ThreadStart(this.DoWork));

            thread.Start();
        }
Пример #5
0
 public void StopScanning()
 {
     this.__State = SearchEngineUrls.Worker.Ide;
 }