예제 #1
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        public static void Main(string[] args)
        {
            Environment.CurrentDirectory = AppDomain.CurrentDomain.BaseDirectory;

            if (args.Length > 0)
            {
                // Parse the command line args
                var install = ParseCommandLine(args);
                if (install == true)
                {
                    InstallationManager.Install(args);
                }
                else if (install == false)
                {
                    InstallationManager.Uninstall(args);
                }
                else
                {
                    Trace.Listeners.Add(new ConsoleTraceListener());
                    Trace.WriteLine("Debugging press return to exit...");
                    var svc = new SyslogSharpService();
                    svc.Debug();
                    Console.ReadLine();
                    Trace.WriteLine("Finished.");

//					Console.WriteLine("Invalid command line args -i for install or -u for uninstall");
                }
            }
            else
            {
                var servicesToRun = new ServiceBase[] { new SyslogSharpService() };

                ServiceBase.Run(servicesToRun);
            }
        }
예제 #2
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        public static void Main(string[] args)
        {
            Environment.CurrentDirectory = AppDomain.CurrentDomain.BaseDirectory;

            if (args.Length > 0)
            {
                // Parse the command line args
                var install = ParseCommandLine(args);
                if (install == true)
                {
                    InstallationManager.Install(args);
                }
                else if (install == false)
                {
                    InstallationManager.Uninstall(args);
                }
                else
                {
            Trace.Listeners.Add(new ConsoleTraceListener());
            Trace.WriteLine("Debugging press return to exit...");
            var svc = new SyslogSharpService();
            svc.Debug();
            Console.ReadLine();
            Trace.WriteLine("Finished.");

            //					Console.WriteLine("Invalid command line args -i for install or -u for uninstall");
                }
            }
            else
            {
                var servicesToRun = new ServiceBase[] { new SyslogSharpService() };

                ServiceBase.Run(servicesToRun);
            }
        }