简体   繁体   English

检查Windows 8手机应用程序中是否打开了GPS和Internet?

[英]Check if GPS and Internet is turned on in windows 8 phone app?

I have an application I want to check whether the device has internet connect and also check whether the GPS is turned on before the start of application. 我有一个应用程序,我想检查设备是否有互联网连接,并检查GPS是否在应用程序启动前打开。 If GPS is off Should direct the user to the settings Location page... and give a popup if internet is off. 如果GPS已关闭应将用户定向到设置位置页面...并在互联网关闭时弹出一个窗口。

can someone please guild me with this. 有人可以请这个给我。

any kind of help is appreciated. 任何形式的帮助表示赞赏。

You can check the DataUsage class 您可以检查DataUsage类

Represents data usage information returned by the ConnectionProfile.GetLocalUsage method. 表示ConnectionProfile.GetLocalUsage方法返回的数据使用信息。

Check the two properties which this class provides ie, the BytesSent and BytesReceived . 检查此类提供的两个属性,即BytesSentBytesReceived

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

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