-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from Cp0204/master
可注册到系统服务(需管理员权限运行开启,实现免登录自启)
- Loading branch information
Showing
8 changed files
with
647 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,26 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using System.ServiceProcess; | ||
using System.Windows.Forms; | ||
|
||
namespace FrpClient_Win | ||
namespace FrpClient_Win | ||
{ | ||
static class Program | ||
{ | ||
/// <summary> | ||
/// 应用程序的主入口点。 | ||
/// </summary> | ||
[STAThread] | ||
static void Main() | ||
static void Main(string[] args) | ||
{ | ||
Application.EnableVisualStyles(); | ||
Application.SetCompatibleTextRenderingDefault(false); | ||
Application.Run(new MainForm()); | ||
if(args.Length > 0 && args[0] == "service") { | ||
ServiceBase[] ServicesToRun; | ||
ServicesToRun = new ServiceBase[] { new autorunService() }; | ||
ServiceBase.Run(ServicesToRun); | ||
} else { | ||
Application.EnableVisualStyles(); | ||
Application.SetCompatibleTextRenderingDefault(false); | ||
Application.Run(new MainForm()); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.