Monday, October 15, 2012

throw an exception in C#

System.ApplicationException ex = new System.ApplicationException("Ouch!");
throw ex;

 
 

throw new Exception(); is more plain-jane but it works too.

No comments:

Post a Comment