AppDomain current = AppDomain.CurrentDomain; current.UnhandledException += new UnhandledExceptionEventHandler(current_UnhandledException);