public static void save(AppConfigInfo i) { if (i == null) i = new AppConfigInfo(); string json = Newtonsoft.Json.JsonConvert.SerializeObject(i); System.IO.File.WriteAllText(ConfigFilePath, json); }
int launch(AppConfigInfo exe) { ProcessStartInfo startInfo = new ProcessStartInfo(); startInfo.FileName = exe.exePath_; startInfo.WorkingDirectory = exe.workingFolder_; startInfo.Arguments = exe.parameter_; startInfo.RedirectStandardOutput = true; startInfo.RedirectStandardError = true; startInfo.UseShellExecute = false; Process p = System.Diagnostics.Process.Start(startInfo); string o = p.StandardOutput.ReadToEnd(); string e = p.StandardError.ReadToEnd(); p.WaitForExit(); return p.ExitCode; }