From 2fe6e73ddc872e79c86821310a01e10238a6a04c Mon Sep 17 00:00:00 2001 From: "MSI\\letre" Date: Mon, 7 Jul 2025 09:29:07 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=96=B0=E5=A2=9E=E3=80=91=20?= =?UTF-8?q?=E6=89=93=E5=BC=80=E6=9C=AC=E5=9C=B0=E5=88=A4=E5=88=86=EF=BC=8C?= =?UTF-8?q?=E8=BE=93=E5=85=A5=E5=91=BD=E5=90=8D=E7=A9=BA=E9=97=B4=EF=BC=8C?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Applications/Program.cs | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/Applications/Program.cs b/Applications/Program.cs index 23dd0ae..05d7e06 100644 --- a/Applications/Program.cs +++ b/Applications/Program.cs @@ -47,11 +47,33 @@ class Program string dbName = context.Request.QueryString["dbName"]; string filepath = context.Request.QueryString["filepath"]; string fileToOpen = context.Request.QueryString["file"]; + string openType = context.Request.QueryString["type"]; + string exePath = context.Request.QueryString["exepath"]; + string workingDirectory = context.Request.QueryString["workingdirectory"]; string ip = context.Request.QueryString["ip"]; string action = context.Request.Url.AbsolutePath.ToLower(); string responseMessage = ""; - if (action == "/start") + if (action == "/openjudgement") + { + string relativePath = ""; + if (openType == "1") + { + string exeName = exePath; + relativePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, exeName); + } + else + { + var startInfo = new ProcessStartInfo + { + FileName = exePath, + WorkingDirectory = workingDirectory, // 必须! + UseShellExecute = true // 或 false,根据需要 + }; + Process.Start(startInfo); + } + } + else if (action == "/start") {