Windows Mobile - 连接到 Internet [英] Windows Mobile - Connect to Internet

查看:42
本文介绍了Windows Mobile - 连接到 Internet的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序定期调用服务器.这需要使用 Wi-Fi 或 GPRS 连接互联网.

My application is making call to server at regular intervals. This requires internet connection either using Wi-Fi or GPRS.

当手机被唤醒(屏幕灯亮起)时,这可以正常工作.但是,一旦电话灯熄灭,它就会发出 HttpWebRequest 并尝试获得 Internet 连接.移动设备开始连接到 Wi-Fi.但是,应用程序不会等待与 Wi-Fi 建立连接.

This works ok when phone is waken (screen light is on). But, as soon as phone lights are off, it makes HttpWebRequest and tried to get Internet connection. Mobile starts connecting to Wi-Fi. But, Application does not wait for establishing connection to Wi-Fi.

  1. 如何在发出 HttpWebRequest 之前连接到 Wi-Fi 或 GPRS?
  2. 如何指定我要连接到 Wi-Fi 或 GPRS?

推荐答案

我认为他们有两种方法:

I think their are two approaches to do:

  1. 您可以创建一个线程并执行您想要的睡眠/恢复活动.
  2. 您可以为特定的时间间隔设置计时器.

这篇关于Windows Mobile - 连接到 Internet的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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