<p>I'm wondering what the best way is to have a "if all else fails catch it".</p>

<p>I mean, you're handling as much exceptions as possible in your application,
but still there are bound to be bugs, so I need to have something that
catches all unhandled exceptions so I can collect information and store
them in a database or submit them to a web service.</p>

<p>Does the AppDomain.CurrentDomain.UnhandledException event capture everything?
Even if the application is multithreaded?</p>

<p>Side note: Windows Vista exposes native API functions that allow any application
to recover itself after a crash... can't think of the name now... but I'd rather not
use it, as many of our users are still using Windows XP.</p>

In ASP.NET, you use the
```
Application_Error
```
function in the
```
Global.asax
```
file.
In WinForms, you use the
```
MyApplication_UnhandledException
```
in the
```
ApplicationEvents
```
file
Both of these functions are called if an unhandled exception occurs in your code. You can log the exception and present a nice message to the user from these functions.