This paper introduces using the Network Location Awareness (NLA) API from managed code. NLA allows applications to identify current logical network connections and be notified of changes to the current network connections.
Mobile PC Network Location Awareness
Mobile PC Network Location Awareness