Exception
catch
try { // ... } catch (Exception ex) { if (ex == UnauthorizedAccessException) // ?? { // ... } else { // ... } }
try { // do something that could throw an exception } catch(Exception e) { if (e is FileNotFoundException) { // ••• } else if (e is DivideByZeroException) { // ••• } else throw; }
try { } catch (Exception ex) { MessageBox.Show(ex.GetType().ToString()); // It will Display Message type }
try { // ... } catch (UnauthorizedAccessException) { // ... } catch (Exception) { // ... }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)