WP7如何在设备调试飞行模式? [英] WP7 How to debug airplane mode on device?

查看:186
本文介绍了WP7如何在设备调试飞行模式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在设备上调试飞行模式?我试着开启飞行模式,在设备设置和禁用我的电脑上的互联网连接,但NetworkInterface.GetIsNetworkAvailable()仍返回true。难道我做错了什么?

Is there a way to debug airplane mode on the device? I tried turning airplane mode on in the device settings and disabling the internet connection on my computer, but NetworkInterface.GetIsNetworkAvailable() still returns true. Am I doing something wrong?

推荐答案

注意上的<一个底部的评论href="http://msdn.microsoft.com/en-us/library/system.net.networkinformation.networkinterface.getisnetworkavailable%28v=VS.95%29.aspx"相对=nofollow>官方文档:

这个API将始终返回true上   在Windows Phone 7模拟器。测试   因此需要一个门面,模拟或   的code条件块。

This API will always return true on the Windows Phone 7 emulator. Testing therefore requires a facade, mock or conditional chunk of code.

我刚刚测试这在实际设备上,事实上,它返回一个恒定的

I just tested this on an actual device and indeed, it returns a constant true.

然而,事情是 - 这一切都是因为你把你的手机连接到PC和以太网接口可用。一旦断开手机与启动应用程序,你会看到一个假将被退回。

However, the thing is - it is all because you keep your phone connected to the PC and the Ethernet interface is available. Once you disconnect the phone and start the app, you will see that a False will be returned.

这篇关于WP7如何在设备调试飞行模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆