110,962
社区成员
发帖
与我相关
我的任务
分享
public string Compile()
{
string strOutput;
Process proCompiler = new Process();
proCompiler.StartInfo.FileName = _strRootPath + "\\bin\\gcc\\bin\\g++.exe";
proCompiler.StartInfo.Arguments = "-o " + _strName + " " + _strName +".cpp";
proCompiler.StartInfo.WorkingDirectory = _strRootPath + "\\bin\\gcc\\bin\\";
proCompiler.StartInfo.UseShellExecute = false;
proCompiler.StartInfo.RedirectStandardInput = true;
proCompiler.StartInfo.RedirectStandardOutput = true;
proCompiler.StartInfo.RedirectStandardError = true;
proCompiler.StartInfo.CreateNoWindow = true;
proCompiler.Start();
strOutput = proCompiler.StandardOutput.ReadToEnd();
proCompiler.Close();
return strOutput;
}
public string Compile()
{
string strOutput;
Process proCompiler = new Process();
proCompiler.StartInfo.FileName = _strRootPath + "\\" + "bin\\fpc\\fpc.exe";
proCompiler.StartInfo.Arguments = _strName + ".pas" + " -vi";
proCompiler.StartInfo.WorkingDirectory = _strRootPath + "\\" + "bin\\fpc\\";
proCompiler.StartInfo.UseShellExecute = false;
proCompiler.StartInfo.RedirectStandardInput = true;
proCompiler.StartInfo.RedirectStandardOutput = true;
proCompiler.StartInfo.RedirectStandardError = true;
proCompiler.StartInfo.CreateNoWindow = true;
proCompiler.Start();
strOutput = proCompiler.StandardOutput.ReadToEnd();
proCompiler.Close();
return strOutput;
}
Process proP = new Process();
proP.StartInfo.FileName = "\\bin\\gcc\\bin\\g++.exe";
proP.StartInfo.UseShellExecute = false;
proP.StartInfo.RedirectStandardError = true;
proP.StartInfo.RedirectStandardInput = true;
proP.StartInfo.RedirectStandardOutput = true;
proP.Start();
textBox1.Text = proP.StandardOutput.ReadToEnd();
proP.Close();
Process p = new Process();
p.StartInfo.FileName = "cmd.exe";
p.StartInfo.Arguments = @"/c help.exe >d:\1.txt";
p.Start();