In Windows 7 (and Vista I think), a network you're connected to is assigned to a "location" e.g. Home / Work or Public.
Is it possible to determine the current network location programatically?
In Windows 7 (and Vista I think), a network you're connected to is assigned to a "location" e.g. Home / Work or Public.
Is it possible to determine the current network location programatically?
Using Windows API Code Pack, you are able to get the same list of networks that Windows shows, by using NetworkListManager.GetNetworks(NetworkConnectivityLevels.All)
.
Then, there's a property named Category
on each network which tells whether it is public or private (home / work). There seems to be no way to distinguish from 'home' and 'work' though.