Ejemplo n.º 1
0
        protected override void OnStart(string[] args)
        {
            Environment.CurrentDirectory = AppDomain.CurrentDomain.BaseDirectory;
            Logger.Init();
            MonitorHistory.Init();
            Logger logger = new Logger("service");

            logger.Error("begin start", new object[0]);
            try
            {
                this.Config          = DNSPodClientLite.Config.Load("service.xml");
                this.Api             = new DNSPodClientLite.Api(this.Config.LoginEmail, this.Config.LoginPassword, this.Config.GetLocal());
                this.Ddns            = new DDns(this.Config.LastIp, this.Config.GetLocal());
                this.Ddns.IPChanged += new Action <string>(this._ddns_IPChanged);
                this.Ddns.Start();
                this.Monitor = new HttpMonitor(this.Config);
                this.Monitor.StatusChanged += new HttpMonitor.DStatusChanged(this.Monitor_StatusChanged);
                this.Monitor.Start();
                logger.Error("end start", new object[0]);
            }
            catch (Exception exception)
            {
                logger.Error("start error:{0}", new object[] { exception });
            }
        }
Ejemplo n.º 2
0
        private static void Main(string[] args)
        {
            Logger.Init();
            MonitorHistory.Init();

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            var dialog = new LoginDialog();

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                Application.Run(new ControlPanelForm());
            }
        }
Ejemplo n.º 3
0
 private static void Main(string[] args)
 {
     if (Environment.UserInteractive)
     {
         Logger.Init();
         MonitorHistory.Init();
         Application.EnableVisualStyles();
         Application.SetCompatibleTextRenderingDefault(false);
         Application.Run(new FLogin());
     }
     else
     {
         ServiceBase.Run(new Service1());
     }
 }