我正在创建在线编译器应用程序。我已经使用 C#.net 和 VB.net 成功创建了。但是当我尝试使用 C 和 C++ 时,我不知道如何在 asp.net 网页中显示错误。
下面只显示错误,不显示错误在代码中的位置
Process proc = new Process();
proc.StartInfo.FileName = Session[batchPath].ToString();
proc.StartInfo.RedirectStandardError = true;
proc.StartInfo.RedirectStandardOutput = true;
proc.StartInfo.UseShellExecute = false;
proc.Start();
是否正确或我应该做任何修改?提前致谢。
最佳答案
您使用 StandardOutput
从流程中获得结果作为
string cResults = proc.StandardOutput.ReadToEnd();
// and then wait to exit.
proc.WaitForExit();
关于c# - c#如何在asp.net网页中显示C程序错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22011819/