/// <summary> /// 应用程序的主入口点。 /// </summary> static void Main(string[] args) { AntDeployAgentWindowsService s = new AntDeployAgentWindowsService(); if (Environment.UserInteractive) { s.RunAsConsole(args); } else { ServiceBase[] ServicesToRun; ServicesToRun = new ServiceBase[] { s }; ServiceBase.Run(ServicesToRun); } }
/// <summary> /// 应用程序的主入口点。 /// </summary> static void Main() { if (Environment.UserInteractive) { AntDeployAgentWindowsService s = new AntDeployAgentWindowsService(); string[] args = { "a", "b" }; s.start(args); } else { ServiceBase[] ServicesToRun; ServicesToRun = new ServiceBase[] { new AntDeployAgentWindowsService() }; ServiceBase.Run(ServicesToRun); } }