I have wrote some VB code to detect when my modem connects to my ISP, then logs the time and date in a log file.

The problem is, i can't work out how to detect when the connection disconnects, and also write that to the log file.