static void MyHandler(object sender, UnhandledExceptionEventArgs args)
{
Exception e = (Exception)args.ExceptionObject;
Log.write("MyHandler caught : " + e.Message);
Log.write(String.Format("Runtime terminating: {0}", args.IsTerminating));
Log.save();
}