WP7可达性

发布于 2024-10-01 16:07:30 字数 1249 浏览 4 评论 0 原文

如果你看看 iPhone,有很多关于如何执行可达性网络检查以及最佳实践的示例:

我发现了以下关于 SO 的现有问题:

我应该在哪里执行可达性检查?

iOS 4 可达性指南

iPhone 可达性检查

Apple 开发者,此外,还有一个如何使用其 Reachability 类的示例: Apple 代码示例

我还没有看到资源WP7 还这样。 AppHub 的示例代码显示了与网络通信的项目,但没有一个(至少我看到)执行可达性检查。此外,虽然 Charles Pretzold 的免费 1000 页 PDF 有许多优秀的示例和解释,但没有其中涉及可达性。

有人这样做过或者找到了可靠的例子吗?

更新:NetworkInterface.GetInternetInterfaceType() 已被证明可以在设备上运行?

If you look at the iPhone, there are many examples on how to perform reachability network checks as well as best practices:

I've found the following existing questions on SO:

Where should I perform a Reachability check?

Reachability Guide for iOS 4

iPhone reachability checking

Apple developers, in addition, have an example of how to use their Reachability class:
Apple Code Example

I haven't seen resources like this for WP7 yet. The AppHub's example code shows projects that communicate to the web, but none (at least that I saw) that perform reachability checks. In addition, though Charles Pretzold's free 1000 page PDF has many excellent examples and explanations, none of them concern reachability.

Has anyone done this yet or found solid examples?

UPDATE: Has NetworkInterface.GetInternetInterfaceType() been proven to work on devices?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

腻橙味 2024-10-08 16:07:30

如果您想知道哪个网络连接当前处于活动状态,您可以执行此操作。

NetworkInterface.GetInternetInterfaceType方法 (Microsoft.Devices.NetworkInformation)

不确定这是否会给你带来你想要的东西。我知道您特别要求通过选定的网络连接进行可达性,但我想您最终可能会得到的结果是找出哪个网络连接处于活动状态..无论如何都要看看,看看它是否有帮助。

If you're wanting to know which network connection is currently active, you can do this.

NetworkInterface.GetInternetInterfaceType Method (Microsoft.Devices.NetworkInformation)

Not sure if that will give you what you're after though. I understand you specifically asked for reachability via a chosen network connection, but figured the result you might be after in the end is to work out which network connection is active.. have a look anyway and see if it helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文