What is the difference between:
catch
{
MessageBox.Show(\"Error.\");
}
and:
catch (Exception ex)
{
MessageBox.Show(
I think they are the same. But the second case raised a compiler warning because you declare an exception you didn't use. I rather like the first one because you say explicitly that you don't use the exception. There is also a third one
catch (Exception)
{
//do something
}
if you want to specify the type of exception but doesn't care about the exception itself.