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)