How can I execute some code when my program experiences a fatal error and crash? For example, something is wrong, and a pop-up window appears that says: "TestApp.exe has encountered an error and should close." and then I want to write to the file with the error code and say a report about the last few things that were entered into the program. How would this be done in C #?
source share