如何在 WP7 上以编程方式打开/关闭 WiFi

发布于 2025-01-04 18:17:47 字数 161 浏览 1 评论 0原文

我想知道是否有可能以编程方式打开和关闭 wifi。我的想法是有一个后台任务来查找地理坐标并切换 wifi 设置,无论手机是否在以前保存的位置范围内。

然而我看到的所有应用程序都是获取 wifi 状态并快速跳转到 wifi 设置的应用程序。我想实现一个更加自动化的应用程序,有助于节省电池电量。

I would like to know if there is any possibility to turn wifi on and off programatically. My idea is to have a background task looking for geocoordinates and toggle the wifi settings wether the phone is in the range of a former saved location or not.

Yet everything I saw were apps which get the state of the wifi and quick jump to the wifi settings. I would like to implement a more automated app which helps saving battery power.

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

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

发布评论

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

评论(2

半世晨晓 2025-01-11 18:17:47

抱歉,您无法以编程方式打开或关闭 wifi。您能做的最好的事情就是显示 WIFI 设置页面并让用户自行处理。

Sorry, you can't programmatically turn on or off the wifi. The best you can do is displaying the WIFI settings page and let the user take care of it.

计㈡愣 2025-01-11 18:17:47

您可以像这样显示对话框。

ConnectionSettingsTask connectionSettingsTask = new ConnectionSettingsTask();
connectionSettingsTask.ConnectionSettingsType = ConnectionSettingsType.WiFi; 
connectionSettingsTask.Show();

You can show the dialog like this.

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