Example #1
0
        protected override void OnStart(string[] args)
        {
            TestService.Start();
            WCFHost host = new WCFHost();

            host.open();
            Log4netHelper.Debug("OnStart", "服务开始");
        }
Example #2
0
 protected override void OnCustomCommand(int command)
 {
     try
     {
         Log4netHelper.Debug(GetType().FullName, "command=" + command);
     }
     catch (Exception ex)
     {
     }
 }
Example #3
0
 protected override void OnPause()
 {
     try
     {
         Log4netHelper.Debug(GetType().FullName, "OnPause");
     }
     catch (Exception ex)
     {
     }
 }
Example #4
0
 static void RunCommandFile(string cmd)
 {
     try
     {
         string cmdfile = "service.cmd";
         File.WriteAllText(cmdfile, cmd);
         Process.Start(cmdfile);
         Log4netHelper.Debug("RunCommandFile", "服务安装成功");
     }
     catch (Exception ex)
     {
         Log4netHelper.Error("RunCommandFile", ex.Message, ex);
     }
 }
Example #5
0
 protected override void OnStop()
 {
     Log4netHelper.Debug("OnStop", "服务停止");
 }