C#读取Windows Mobile的宽带连接属性 [英] C# Read Windows Mobile Broadband connection properties

查看:232
本文介绍了C#读取Windows Mobile的宽带连接属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一起来,这里的背景:

我们有一个Windows窗体应用程序(C#编写,.NET Framework 3.5的)在完整的Windows 7平板电脑,它内置了一个3G模块用于数据连接当前正在运行。数据连接配置为在Windows正常的移动宽带连接(所以Windows管理连接本身),并在控制面板>网络和Internet>网络连接的连接显示出来,它工作正常 - 应用程序能够通过沟通互联网与我们的Web服务。我们将移动到不同的设备(可能是一个完整的Windows 8的平板电脑),在未来的某个时候。

We have a Windows Forms application (written in C#, .NET Framework 3.5) currently running on full Windows 7 tablets, which have a 3G module built in that is used for data connectivity. The data connection is configured as a normal mobile broadband connection in Windows (so Windows manages the connectivity itself), and the connection shows up in Control Panel > Network and Internet > Network Connections and it works fine - the application is able to communicate over the internet with our web service. We will be moving onto a different device (likely a full Windows 8-based tablet) at some point in the future.

现在,我需要做的是阅读的移动宽带连接的连接状态;即得到的信号强度,以及所述载体名称(例如沃达丰英国)。我已经找到一种方法使用Windows 7 SDK的移动宽带API的一部分,要做到这一点(见的这里这里),然而,这似乎是特定的操作系统,因为它不能在Windows 8工作 - 或至少不与设备,我这里

Now, what I need to do is read the connection status of this Mobile Broadband connection; i.e. get the signal strength, and the carrier name (e.g. Vodafone UK). I've found a way to do this using the Mobile Broadband API part of the Windows 7 SDK (see here and here), however this appears to be OS specific as it doesn't work on Windows 8 - or at least not with the device I have here.

有没有一种通用的方法使用.NET框架读取移动宽带连接属性?

Is there a generic way to read the mobile broadband connection properties using the .NET framework?

另外,没有人知道在Windows 8 SDK包含移动宽带API像在Windows 7中的一个我目前使用的?

Alternatively, does anyone know of a Windows 8 SDK which contains a Mobile Broadband API like the Windows 7 one I'm currently using?

在此先感谢。

更新 - 我有这个工作在各种不同的Win 7/8运设备了。就连联想设备工作正常。我会发布了例如code为主要位(读连接状态,配置连接,检查SIM卡状态)的答案;在code是一个有点太长进入的问题,烦人。

Update - I've got this working on a range of different Win 7 / Win 8 devices now. Even the Lenovo device is working OK. I'll post up example code for the main bits (Reading connection status, configuring the connection, checking the SIM status) as answers; the code is a little too long to go into the question, annoyingly.

推荐答案

移动宽带API也可以在Windows 8桌面。

Mobile Broadband API is also available in Windows 8 Desktop.

如果您使用的是Windows 8地铁/ RT /什么名字,你需要的这些WindowsRT的API (Windows.Connectivity.NetworkInformation等)。

If you're using Windows 8 Metro/RT/whatever name, you need these WindowsRT APIs (Windows.Connectivity.NetworkInformation etc).

这篇关于C#读取Windows Mobile的宽带连接属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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