I have a service that runs and I\'d like to receive notification when:
a) the network is connected.
b) when a user logs in to the machine.
How can I do
You can't do b) with .NET 2.0. For XP and before, you need to create a GINA replacement, which is an unmanaged DLL which exports a specified set of functions.
In Vista, there is a different COM-based model which you have to use which you might be able to use .NET 2.0 for, but I wouldn't be surprised if you can't.
What I would do is have your GINA replacement (or the equivalent on Vista) send a signal of some kind to your service.
For a) these two links should be able to help:
Network Awareness in Windows XP
http://msdn.microsoft.com/en-us/library/ms700657(VS.85).aspx
Network Awareness on Windows Vista
http://msdn.microsoft.com/en-us/library/ms697388(VS.85).aspx