Esempio n. 1
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            iphelper.LoadConfig();

            txtID.Text             = iphelper.ID;
            txtDomain.Text         = iphelper.Domain;
            txtToken.Text          = iphelper.Token;
            numSeconds.Value       = iphelper.TimeLoop;
            txtHost.Lines          = iphelper.Hosts;
            txtLogFile.Text        = iphelper.LogFile;
            chkLogIPChange.Checked = iphelper.LogIPChange;
            chkLogNotify.Checked   = iphelper.LogNotify;

            timer.Enabled = true;;

            timer_Tick(sender, e);
        }
Esempio n. 2
0
        protected override void OnStart(string[] args)
        {
            Log("服务开始载入配置");
            string path = Path.GetDirectoryName(System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName);

            iphelper.ConfigFile = path + "\\Setting.ini";
            iphelper.LoadConfig();
            Log("服务开始启动");

            if (iphelper.LogNotify)
            {
                iphelper.OnNotifyMsg += new Action <string>(Log);
            }
            if (iphelper.LogIPChange)
            {
                iphelper.OnIPChanged += new Action <string>(OnIpChange);
            }

            iphelper.StartHooking();
        }