예제 #1
0
파일: Program.cs 프로젝트: Alexou/dotSearch
        static void Main(string[] args)
        {
            if (args.Count() < 2)
            {
                Console.WriteLine("Erreur: Argument 1: url, Argument 2: profondeur de parcours");

            }

            BotPage botPage = new BotPage(args[0].Normalize(), System.Int32.Parse(args[1]));
            List<string> Errors= new List<string>();
            Stopwatch sw = new Stopwatch();
            sw.Start();
            botPage.Run();

            sw.Stop();
            foreach (string e in botPage.Errors)
            {
                Console.WriteLine("Error: {0}", e);
            }
            Console.WriteLine("\n\nfin {0}", sw.ElapsedMilliseconds);
            Console.Beep(440, 200);
            Console.WriteLine("Niveau : {0} Nb de lien interne : {1}\nOccurences:", botPage.Depth, botPage.BotLinks.Count, botPage.Pages.Count);
            int somme = 0;
            foreach (Page p in botPage.Pages)
            {
                somme += p.Occurences.Count;
            }
            Console.WriteLine("occurences:"+somme);
            foreach (Link l in botPage.BotLinks)
            {
                Console.WriteLine(l.Url);
            }
            Console.Read();
        }
예제 #2
0
 private void RunBot_button_Click(object sender, RoutedEventArgs e)
 {
     BotPage botPage = new BotPage(StartUrl_textBox.Text, System.Int32.Parse(Depth_textBox.Text));
     Stopwatch sw = new Stopwatch();
     sw.Start();
      botPage.Run();
     sw.Stop();
     TimeElapsedValue_label.Content = sw.ElapsedMilliseconds.ToString();
 }