WinForm: Find if network connection is metered (network cost)

时间:2018-04-20 21:18:22

标签: c# winforms networking

In a Universal Windows Platform application, there are APIs such as GetInternetConnectionProfile() to find out whether a network connection has a cost associated to it, i.e. metered connection.

Is there a way a WinForm desktop application can find out if the network connection with active internet is metered connection?

1 个答案:

答案 0 :(得分:1)

为什么不直接调用提供的UWP类?很可能来自非UWP项目。只需添加引用并使用即可。这里显示了一些例子;

https://blogs.windows.com/buildingapps/2017/01/25/calling-windows-10-apis-desktop-application/