コード例 #1
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main(string[] args)
        {
            // set up error handling
            AppDomain.CurrentDomain.UnhandledException += AppDomainUnhandledException;

            // set up logging
            string path = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);

            LogFile = string.Format("{0}\\DynDnsClient.log", path);

            // log startup message
            Log("Starting");

            // install or uninstall, if requested (-i or -u)
            MyInstallerBase installer  = new MyInstallerBase(typeof(DynDnsClient), Log);
            bool            didInstall = installer.Install(args);

            if (didInstall)
            {
                return; // quit after an installation
            }

            // run direct or as console (-c)
            MyServiceBase service = new MyServiceBase(SERVICE_NAME, MainAction, Log);

            service.Run(args);

            // log shutdown message (graceful)
            Log("Exiting");
        }
コード例 #2
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main(string[] args)
        {
            // set up error handling
            AppDomain.CurrentDomain.UnhandledException += AppDomainUnhandledException;

            // set up logging
            string path = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
            LogFile = string.Format("{0}\\DynDnsClient.log", path);

            // log startup message
            Log("Starting");

            // install or uninstall, if requested (-i or -u)
            MyInstallerBase installer = new MyInstallerBase(typeof(DynDnsClient), Log);
            bool didInstall = installer.Install(args);
            if (didInstall)
            {
                return; // quit after an installation
            }

            // run direct or as console (-c)
            MyServiceBase service = new MyServiceBase(SERVICE_NAME, MainAction, Log);
            service.Run(args);

            // log shutdown message (graceful)
            Log("Exiting");
        }