views:

32

answers:

1

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?

+2  A: 

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.

Julien Lebosquain
That looks like the closest I'm going to get. Thanks.
Gareth