1234567891011121314151617181920212223242526272829303132 |
- using System;
- using System.Diagnostics;
- using System.ServiceProcess;
- using System.Windows.Forms;
- namespace JLHHJSvr
- {
- static class Program
- {
- /// <summary>
- /// 应用程序的主入口点。
- /// </summary>
- [STAThread]
- static void Main()
- {
- if (Environment.UserInteractive)
- {
- // 界面运行
- Application.EnableVisualStyles();
- Application.SetCompatibleTextRenderingDefault(false);
- Application.Run(new Form1());
- }
- else
- {
- ServiceBase[] ServicesToRun;
- ServicesToRun = new ServiceBase[] { new JLHHJSvr(), };
- ServiceBase.Run(ServicesToRun);
- }
- }
- }
- }
|