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") {