PDA

Click to See Complete Forum and Search --> : [RESOLVED] Easy Question


zdavis
Mar 20th, 2007, 03:06 PM
I know this is a noob question however in a c# application what does the following do

{...}

at the end of catch statement.

notrosh

Jumpercables
Mar 20th, 2007, 04:23 PM
The following coded will catch all exceptions and then do nothing, you should always do something when catching an exception, but there are always special cases.


try
{
// Try something
}catch
{
// Catch all exceptions and do nothing...
}

Crash893
Mar 21st, 2007, 07:44 PM
you can also do a

try
{
}
catch (Exception ex)
{
MessageBox.Show("your error message goes here" + Environment.NewLine + ex.Message);
Console.WriteLine(ex.ToString());
}