Exemple #1
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();
        }
Exemple #2
0
 private void button1_Click(object sender, EventArgs e)
 {
     iphelper.OnIPChanged += new Action <string>(OnIpChange);
     iphelper.StartHooking();
 }