Add WindowsJobAPI

This commit is contained in:
ChsBuffer
2021-11-12 00:00:28 +08:00
parent 4f5e5ab804
commit 3f51f7f635
3 changed files with 5 additions and 0 deletions

View File

@@ -70,6 +70,7 @@ namespace Netch.Controllers
Instance.StartInfo.Arguments = argument;
Instance.Start();
Global.Job.AddProcess(Instance);
if (priority != ProcessPriorityClass.Normal)
Instance.PriorityClass = priority;

View File

@@ -7,6 +7,7 @@ using System.Windows.Forms;
using Netch.Forms;
using Netch.Models;
using Netch.Models.Modes;
using WindowsJobAPI;
namespace Netch
{
@@ -22,6 +23,8 @@ namespace Netch
/// </summary>
public static Setting Settings = new();
public static readonly JobObject Job = new();
/// <summary>
/// 用于存储模式
/// </summary>

View File

@@ -53,6 +53,7 @@
<PackageReference Include="WindowsFirewallHelper" Version="2.1.4.81" />
<PackageReference Include="System.ServiceProcess.ServiceController" Version="6.0.0" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="6.0.0" />
<PackageReference Include="WindowsJobAPI" Version="5.0.1" />
</ItemGroup>
<ItemGroup>