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(); }
void currentDomain_ProcessExit(object sender, EventArgs e) { FreeLibrary(Handle); Log.save(); }