Пример #1
0
        private static void Main(string[] args)
        {
            AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;

            if (Environment.UserInteractive)
            {
                var service = new DnsCheckerService();
                service.StartDaemon();
                Console.ReadKey();
            }
            else
            {
                ServiceBase.Run(new DnsCheckerService());
            }
        }
Пример #2
0
        private static void Main(string[] args)
        {
            AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;

            if (Environment.UserInteractive || args.Any())
            {
                var options = new Options();

                if (CommandLine.Parser.Default.ParseArgumentsStrict(args, options,
                                                                    () =>
                                                                    Console.WriteLine("Bad command line parameters.")))
                {
                    var service = new DnsCheckerService();
                    service.StartConsole();
                }
            }
            else
            {
                ServiceBase.Run(new DnsCheckerService());
            }
        }
Пример #3
0
        private static void Main(string[] args)
        {
            AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;

            if (Environment.UserInteractive || args.Any())
            {
                var options = new Options();

                if (CommandLine.Parser.Default.ParseArgumentsStrict(args, options,
                                                                    () =>
                                                                    Console.WriteLine("Bad command line parameters.")))
                {
                    var service = new DnsCheckerService();
                    service.StartConsole();
                }
            }
            else
            {
                ServiceBase.Run(new DnsCheckerService());
            }
        }