测试 Windows Phone 7 中的连接问题(使用模拟器)
Windows Phone 7 模拟器中有没有办法关闭网络连接(无需拔下电缆并关闭笔记本电脑上的 Wi-Fi)?我想在没有物理设备或在模拟器或 Windows Phone 7 SDK/工具之外执行任何物理操作的情况下测试网络连接的下降。
Is there a way in the Windows Phone 7 emulator to turn off the network connection (without yanking the cable and turning wi-fi off on my laptop)? I want to test the dropping of network connectivity without having a physical device or doing anything physical outside the emulator or the Windows Phone 7 SDK/Tools.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
作为物理禁用网络连接的替代方法,有时我还发现通过 Fiddler2。然后可以使用断点来拦截某些连接。然后,您可以使用此命令在服务器响应之前添加延迟。或者您可以强制超时。
当您想要测试某些连接失败而不测试其他连接时,我发现这是一种有用的方法。
As an alternative to physically disabling the network connection I also, sometimes, find it useful to redirect the network connections through Fiddler2. It's then possible to use breakpoints to intercept some connections. You can then use this add a delay before the server can respond. Or you can force a timeout.
I find this a useful approach when you want to test some connections failing but not others.
不,不是真的。我发现检查网络连接并将结果分配给布尔值很有用,以便我可以修改结果以测试没有网络连接的场景。
No, not really. I find it useful to check network connectivity and assign the result to a boolean value so that I can then modify the result to test scenarios where there's no network connection.
为应用程序
C:\Program Files\Microsoft XDE\1.0\XDE.exe
创建防火墙规则,然后启用/禁用此规则。Сreate a firewall rule for the application
C:\Program Files\Microsoft XDE\1.0\XDE.exe
and then enable/disable this rule.您可以使用 Fiddler 中的自定义规则来执行此操作。
规则->自定义规则...
找到添加“模拟和调制解调器速度”菜单选项的代码,然后添加新选项
现在,在 OnBeforeRequest 函数的顶部,添加以下代码
现在,在“性能”菜单下,您可以可以选择“飞行模式” - 或任何您想要的名称。
(基于 @EricLaw Google 网上论坛帖子)
You can do this using a custom rule in Fiddler.
Rules -> Customize Rules...
Find the code which adds the "Simulate &Modem Speeds" menu option, and add your new option
Now, at the top of the OnBeforeRequest function, add the following code
Now, under the 'Performance' menu, you can select 'Flight Mode' - or whatever you want to call it.
(Based on an @EricLaw Google Groups post)