Exemple #1
0
 static void RunAsConsoleApp(string[] args, CrawlService crawlService)
 {
     Console.WriteLine("Hit enter at any time to stop the program");
     crawlService.OnStart(args);
     Console.Read();
     crawlService.OnStop();
 }
Exemple #2
0
        static void Main(string[] args)
        {
            CrawlService crawlService = new CrawlService();

            if (Environment.UserInteractive)
            {
                RunAsConsoleApp(args, crawlService);
            }
            else
            {
                RunAsWindowsService(crawlService);
            }
        }
Exemple #3
0
 static void RunAsWindowsService(CrawlService crawlService)
 {
     ServiceBase.Run(new ServiceBase[] { crawlService });
 }