Making a Windows Forms app respond to System Shutdown

I wrote an article on how to do this that I posted recently to my Radio blog, but since (at the moment) I'm moving everything to .Text here's a new link to it.