开发者

why does windows phone 7 NetworkInterface.GetIsNetworkAvailable() return true when airplane mode is enabled

开发者 https://www.devze.com 2023-03-20 00:39 出处:网络
i have a windows phone 7 app that communicates with a web service.i\'ve been looking at other questions that answer how to detect if there is a network connection.I thought \'fantastic\' i\'ve found m

i have a windows phone 7 app that communicates with a web service. i've been looking at other questions that answer how to detect if there is a network connection. I thought 'fantastic' i've found my answer.

However, the call to NetworkInterface.GetIsNetworkAvailable() always returns true. It returns true in the emulator, it returns true on a device with airplane mode enabled, it returns true on device when airplane mode is disabled.

as further details, i have the开发者_StackOverflow社区 latest beta SDK (7.1 - mango) running.

Anyone have an idea?


This method will always return true in debug mode.

The emulator is always connected to the host PC and so always has a connection.

If debugging on an actual device, the USB connection is a connection and so there is always a connection there.

The only way to test this method is on an actual device when not connected to a PC.

0

精彩评论

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