This email was created by [MemberName] <[MemberEmail]> who thought you would be interested in the following Article:
"Detect browser closing through clicks on the [X] button"
This explains the technique to detect Window closing with C# and how to close user sessions safely at the same time.
CodeProject also contains hundreds of articles, free source code samples and applications to help in your day to day programming. Why not give it a try!