示例#1
0
        // The main entry point for the process
        public static void Main(string[] args)
        {
            if (args.Length > 0)
            {
                Log.WriteLine("Starting up");
                IpTracker app = new IpTracker();
                app.Start();

                System.Console.Read();

                app.Stop();
                Log.WriteLine("Shutting down");
            }
            else
            {
                ServiceBase[] ServicesToRun;
                ServicesToRun = new ServiceBase[] { new Service() };
                ServiceBase.Run(ServicesToRun);
            }
        }
示例#2
0
        public static void TimerMethod(object state)
        {
            IpTracker service = (IpTracker)state;

            service.TimerMethod();
        }