【以下都是自己学习中发现的一些问题,如有任何问题请指正】

   我相信做过windows mobile开发的都知道,自己的程序都要去建立连接的,尤其是在一些要使用wap

网关的时候,我们都要在程序中建立连接。那么WP7是否还需要了?

      答案当然是不需要了。

     

When Windows Phone starts, it can take up to 20 seconds for the first call to the M:System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable to return. This is because Windows Phone initially enumerates all the available network connections.

     以上见Windows Phone 7最新离线文档。

     那么我们网络不可用怎么办了?

     我们可以使用如下方式判断。

    

using System.Net.NetworkInformation;

bool bNetOK = NetworkInterface.GetIsNetworkAvailable();

    网络不可用时提示用户即可。

    PS:这是第一次发大家见谅。

相关文章:

  • 2022-01-08
  • 2021-08-09
  • 2021-06-22
  • 2022-12-23
  • 2022-12-23
  • 2022-02-25
猜你喜欢
  • 2021-09-28
  • 2022-12-23
  • 2021-08-22
  • 2022-12-23
  • 2021-07-28
  • 2021-12-29
  • 2021-11-23
相关资源
相似解决方案