From c1bbd46a32a9173ef946be440f9da059d02f9115 Mon Sep 17 00:00:00 2001 From: dlaren Date: Thu, 7 Aug 2025 15:38:23 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91=20?= =?UTF-8?q?=E8=AF=95=E5=8D=B7=E8=BD=AF=E4=BB=B6=E7=8E=AF=E5=A2=83=E6=A3=80?= =?UTF-8?q?=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Applications/AppCheck.cs | 2 ++ Applications/Program.cs | 15 +++------------ 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/Applications/AppCheck.cs b/Applications/AppCheck.cs index 0c7df03..1814adf 100644 --- a/Applications/AppCheck.cs +++ b/Applications/AppCheck.cs @@ -10,5 +10,7 @@ namespace Applications { public string Id { get; set; } public string appName { get; set; } + + public string taskId { get; set; } } } diff --git a/Applications/Program.cs b/Applications/Program.cs index 3f16dac..e879153 100644 --- a/Applications/Program.cs +++ b/Applications/Program.cs @@ -63,6 +63,8 @@ class Program // 需要被打包的 源目录路径 string sourceDir = context.Request.QueryString["sourceDir"]; string ip = context.Request.QueryString["ip"]; + // 方案ID + string taskId = context.Request.QueryString["taskId"]; string action = context.Request.Url.AbsolutePath.ToLower(); string responseMessage = ""; // 压缩文件方法 @@ -197,12 +199,8 @@ class Program } else if (action == "/start") { - - if (path == "navicat") { - - // 启动指定服务(MySQL 服务)//需要用管理员身份启动 string serviceName = "wampmysqld"; // ← 请确认服务名 try @@ -226,10 +224,6 @@ class Program { Console.WriteLine($"❌ 启动服务失败:{ex.Message}"); } - - - - // 获取当前用户的 SID string userSid = WindowsIdentity.GetCurrent().User?.Value; if (userSid == null) @@ -237,10 +231,7 @@ class Program Console.WriteLine("❌ 无法获取当前用户 SID"); return; } - string subKeyPath = $@"{userSid}\Software\PremiumSoft\Navicat\Servers\答题专用"; - - Console.WriteLine("当前用户 subKeyPath" + subKeyPath); try @@ -401,7 +392,7 @@ class Program } else if (action == "/check") { - string apiUrl = "http://" + ip + ":48080/admin-api/exam/app/getAppCheckList"; // ← 替换成你的接口地址 + string apiUrl = "http://" + ip + ":48080/admin-api/exam/app/getAppCheckList/" + taskId; // ← 替换成你的接口地址 List softwareList = await FetchSoftwareListFromApi(apiUrl); List result = new List(); foreach (AppCheck softwareLine in softwareList)