简体   繁体   English

Windows应用商店网络

[英]Windows Store Application Networking

I have created a windows store application that prints out network information using the using Windows.Networking.Connectivity; 我创建了一个Windows存储应用程序,该应用程序使用Windows.Networking.Connectivity;打印出网络信息Windows.Networking.Connectivity; name space. 名称空间。

Although the application is running and working correctly, the MegabytesUsed method is return " Not Defined ". 尽管应用程序正在运行且正常运行,但是MegabytesUsed方法返回“ Not Defined ”。 why is this. 为什么是这样。

If you run the app in Local Machine and you are connected with ethernet you dont use DataPlan. 如果您在本地计算机上运行该应用程序,并且已与以太网连接,则不要使用DataPlan。

If you want to debug open with Simulator and enable "Use simulated network prperties" and then change Data Limit Status Flag and you will see results. 如果要使用Simulator调试打开并启用“使用模拟的网络属性”,然后更改“数据限制状态标志”,您将看到结果。

ConnectionProfile profile =  NetworkInformation.GetInternetConnectionProfile();
DataPlanStatus dps = profile .GetDataPlanStatus() ;
textBlock.Text =  dps.DataPlanUsage.MegabytesUsed.ToString();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM