So you wish to have this functionality in a Windows Forms project is that correct? If you want this monitoring to be done in the background you will have to make this multithreaded by creating Worker thread, etc.
I could probably whip up a sample here that started the monitor thread and ran it until a button on the form was clicked. Is that what you are looking for?