standards-c-sharp

Be specific in what you catch

Don’t

try
{
    OpenFile("myfile.txt");
}
catch (System.Exception)
{
    // some generic handling code
}

Do

try
{
    OpenFile("myfile.txt);
}
catch (System.IO.DriveNotFoundException)
{
    // inform the user they specified an invalid drive
}
catch (System.IO.FileNotFoundException)
{
    // create the file and retry
}
// etc.