I am creating online compilers application. I have successfully created with C#.net and VB.net. But when I am trying with C and C++ I don't know how to display the errors in asp.net webpage.
The following only displays the error but not the location of the error in the code
Process proc = new Process();
proc.StartInfo.FileName = Session[batchPath].ToString();
proc.StartInfo.RedirectStandardError = true;
proc.StartInfo.RedirectStandardOutput = true;
proc.StartInfo.UseShellExecute = false;
proc.Start();
Is it right or I should do any modification? Thanks in advance.
You can handle default errors at the application level either by modifying your application's configuration or by adding an Application_Error handler in the Global. asax file of your application. You can handle default errors and HTTP errors by adding a customErrors section to the Web. config file.
Apart from the try catch exception handling technique, the ASP.NET Framework has error handling events where exceptions can be caught. When there is an unhandled error at the code level, meaning if the code does not have a structured try catch block to handle exceptions, then that can be handled at the page level.
Using JavaScriptAdd a new aspx page to the project, then add an ASP TextBox and Button to the aspx page. Then add a CustomValidator Control to the aspx page by going to the ToolBox then under that click Validation, select CustomValidator, then drag it to the page.
There are 5 different types of errors in C programming language: Syntax error, Run Time error, Logical error, Semantic error, and Linker error. Syntax errors, linker errors, and semantic errors can be identified by the compiler during compilation.
You get the results from your Process using the StandardOutput
as
string cResults = proc.StandardOutput.ReadToEnd();
// and then wait to exit.
proc.WaitForExit();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With