hi , i am new to progrramming , i want to do execption handlling so that user can not see that yellow page , i want the list of code with which we can show our custom message to end user rather than yellow , does any body help me , can it be done by using configration file where we store all the error code accroding to that we show message
Loading
Ryan AlfordPosted Nov 27, 2007, 2:51 PM
for example:
how to catch the "divide by zero" error
try
{
var1 = var2 / 0
}
catch (System.DivideByZeroException ex)
{
Messagebox.Show("Cannot divide by zero.", "Divide By Zero Error", MessageBoxButtons.OK, MessageBoxIcons.Error);
return;
}
This will show a custom message box with your text instead of the generic, hard to read error messsages that crash the application.