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

            host.open();
            Log4netHelper.Debug("OnStart", "服务开始");
        }
예제 #2
0
 protected override void OnCustomCommand(int command)
 {
     try
     {
         Log4netHelper.Debug(GetType().FullName, "command=" + command);
     }
     catch (Exception ex)
     {
     }
 }
예제 #3
0
 protected override void OnPause()
 {
     try
     {
         Log4netHelper.Debug(GetType().FullName, "OnPause");
     }
     catch (Exception ex)
     {
     }
 }
예제 #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);
     }
 }
예제 #5
0
 protected override void OnStop()
 {
     Log4netHelper.Debug("OnStop", "服务停止");
 }