开发者

How do I determine "Network Location" in .NET?

开发者_StackOverflow社区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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜