c# - c#如何在asp.net网页中显示C程序错误

标签 c# c++ asp.net c compiler-construction

我正在创建在线编译器应用程序。我已经使用 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/

相关文章:

c++ - += 在没有 boost 的 vector 上

c# - ASP.Net MVC 返回 Json 作为 IActionResult 修改对象键名

C# 异步套接字服务器未收到来自 Java 客户端的响应

c++ - 如何在 C++ 中计算 a/b?

c# - 如何访问数据流脚本组件中现有的 ADO.NET 连接管理器

C# 通过引用 C++ ActiveX 控件传递 int 和字符串 : type mismatch

asp.net - OLEDBException:vb.net 中没有为一个或多个必需参数给出值

c# - jQUery ajax 调用 asp.net webforms 返回 html 页面而不是调用 url 中的指定方法

c# - CS 学生的现代 Powerbuilder 与 C#/Java/C++

C# 使用语句和 iDisposable