public String ShellAction(String command) { if (RunProcess.Run(command)) { return(JsonConstructor.SendMessage(true, "成功")); } else { return(JsonConstructor.SendMessage(false, "脚本不存在或执行失败")); } }
public static ProcessExitInfo RunExecutable(string ExeName, string Params, string WorkingDirectory) { RunProcess myProc = new RunProcess(ExeName, Params, WorkingDirectory); return(myProc.Run()); }
/// <summary> /// Runs an Executable and returns the output /// </summary> /// <param name="ExeName">The full path and name of the executable</param> /// <param name="Params">The parameters for the exe</param> /// <returns>string containing the STDOUT of the process</returns> public static ProcessExitInfo RunExecutable(string ExeName, string Params) { RunProcess myProc = new RunProcess(ExeName, Params); return(myProc.Run()); }
static void Main(string[] args) { RunProcess runProcess = new RunProcess(); runProcess.Run(); }