CSScriptCompilers.CSCompiler.RunApp C# (CSharp) Метод

RunApp() статический приватный Метод

static private RunApp ( string workingDir, string app, string args ) : string
workingDir string
app string
args string
Результат string
        static string RunApp(string workingDir, string app, string args)
        {
            Process myProcess = new Process();
            myProcess.StartInfo.FileName = app;
            myProcess.StartInfo.Arguments = args;
            myProcess.StartInfo.WorkingDirectory = workingDir;
            myProcess.StartInfo.UseShellExecute = false;
            myProcess.StartInfo.RedirectStandardOutput = true;
            myProcess.StartInfo.CreateNoWindow = true;
            myProcess.Start();

            StringBuilder builder = new StringBuilder();

            string line = null;
            while (null != (line = myProcess.StandardOutput.ReadLine()))
            {
                builder.Append(line + "\n");
            }
            myProcess.WaitForExit();

            return builder.ToString();
        }