Beispiel #1
0
        public UrlScannerTests()
        {
            scanner = new UrlScanner();

            for (int i = 0; i < TextConverter.UrlPatterns.Count; i++)
            {
                scanner.Add(TextConverter.UrlPatterns[i]);
            }
        }
        public ActionResult Index(StartScan model)
        {
            if (!ModelState.IsValid)
            {
                return(View("Index"));
            }

            UrlScannerSource source = new UrlScannerSource()
            {
                Url             = model.StartUrl,
                Text            = model.SearchText,
                MaxCountThreads = model.MaxCountThreads,
                MaxCountUrls    = model.MaxCountUrls
            };

            UrlScanner.GetUrlScanner(true).Setup(source);

            return(RedirectToActionPermanent("Scan", "Scan"));
        }
 public ScanController(IRepository <UrlScan> repository)
 {
     this.repository = repository;
     scanner         = UrlScanner.GetUrlScanner();
 }