예제 #1
0
파일: Program.cs 프로젝트: razvalex/WanVet
        private static void RunAsService(string[] args)
        {
            var win32Service = new Win32Service(args.Where(a => a != RunAsServiceFlag).ToArray());
            var serviceHost  = new Win32ServiceHost(win32Service);

            serviceHost.Run();
        }
예제 #2
0
파일: Program.cs 프로젝트: razvalex/WanVet
        private static void RunInteractive(string[] args)
        {
            var win32Service = new Win32Service(args.Where(a => a != InteractiveFlag).ToArray());

            win32Service.Start(new string[0], () => { });
            Console.WriteLine(win32Service.ServiceName);
            Console.WriteLine("Running interactively, press enter to stop.");
            Console.ReadLine();
            win32Service.Stop();
        }