uses some of the properties of the Exception class
using System;
using System.Reflection;
public class Starter {
public static bool bException = true;
public static void Main() {
try {
MethodA();
} catch (Exception except) {
Console.WriteLine(except.Message);
bException = false;
except.TargetSite.Invoke(null, null);
}
}
public static void MethodA() {
if (bException) {
throw new ApplicationException("exception message");
}
}
}
|
HTML code for linking to this page:
Related in same category :
-
-
-
-
-
-
-
-
-
|