private static void HandleException(Exception e) { string err = e.ToString(); ExceptionForm form = new ExceptionForm(); form.ShowException(err); System.IO.File.WriteAllText("lasterror.txt", err); }