C# mimics VB’s On Error Resume next
and adds a try catch. The exception is not handled in catch
Try
{
the for (int I = 0; i < 10; I++)
{
try
{
int p = 0;
int d = I/p;// is zero, will go wrong
and adds a try catch. The exception is not handled in catch
Try
{
the for (int I = 0; i < 10; I++)
{
try
{
int p = 0;
int d = I/p;// is zero, will go wrong
} catch
attach MessageBox. Show (i.T oString ());// here say, will cycle through ten times
}}
the catch (Exception ex)
{
MessageBox. Show (ex. Message); // because the error divided by zero is caught by the inner try catch, the outer try catch will not catch the error divided by zero
}
Read More:
- How to use it RegAsm.exe Register C in a development / production environment#/ VB.NET Developed DLL
- Experience of using on error resume next in VBScript
- On error goto (resume)
- SQLServerException: The server failed to resume the transaction. Desc:ab00000002
- An example of 3D data modeling based on VB6 + OpenGL
- Solution to prompt run time error “438” when a VB program is opened
- C language string processing error warning, c4996, sprintf, predicted, c4996, strcpy, c4996, strcat
- [Solved] Dev-C++ [Error] ‘for‘ loop initial declarations are only allowed in C99 or C11 mode
- Solution to the problem of no C / C + + option in the new project of eclipse
- Error C2664 in C + + compilation: cannot convert parameter 2 from “const char [5]” to “lpctstr” solution.
- Solve the problem of error: cannot pass objects of non trivially copyable type ‘STD:: String’ in C / C + +
- MPI cannot be found in C / C + +
- VB error run time error ’91’
- error C2057: expected constant expression (Can the size of an array in C language be defined when the program is running?)
- Fatal error C1853 error occurs when there are mixed .c files in the VS project
- Solutions to error c2143: syntax error: missing ‘;’ before ‘type’ in C + + program compilation
- C # generate data in DataGridView into XML file
- Three kinds of errors in C + + program
- Error in .Call.graphics(C_palette2, .Call(C_palette2, NULL)) : invalid graphics state