使用IMEI号检测usb端口 [英] Detect usb Ports With IMEI No

查看:126
本文介绍了使用IMEI号检测usb端口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我已经部署了几个usb调制解调器(主要是huawei),它们在SMS服务器设置中用作SMS代理。



问题在于,有时当重新启动时,某些设备会重新分配给其他COM端口插槽。由于程序无法再访问串行端口/ COM端口,因此会导致问题。需要手动重新分配。



我的解决方案是保存数据库中所有设备的IMEI号码。当我的程序运行时,它从数据库获取IMEI号,并尝试检测所有三个端口,我选择的IMEI号相同。



我的问题是如何检测usb端口IMEI号码?

解决方案

通常,USB正常的com / serial设备允许您修复设备管理器中的端口,以便它始终获得该端口。



如果您的设备不是这种情况,那么一个好的起点就是WMI。从微软下载WMI代码创建器,遗憾的是我没有在USB上连接调制解调器,所以不能给出一个具体的例子,但从查看WIN32_SerialPort类开始;如果您设置语言(默认为C#),WMI代码创建器将为您生成代码,您可以将其合并到您的程序中。



希望有所帮助,祝你好运

Hi,

I have deployed several usb modems (mostly huawei) which are used as SMS agents in an SMS server setup.

The problem is that sometimes when a reboot happens, some devices are re-assigned to other COM port slots. It causes problems since the program can no longer access the serial port/COM port. It needs to be reassigned manually.

My solution is to save IMEI numbers of all devices in database. When my program run it gets IMEI number from database and tries to detect all three ports with same IMEI number that I select.

My question is how to detect usb ports with IMEI number?

解决方案

Usually a USB proper com/serial device allows you to fix the port in device manager so that it always gets that port.

If that is not the case for your devices then a good place to start is WMI. Download the WMI Code Creator from Microsoft, unfortunately I do not have a modem attached on USB so can not give a specific example but start with looking at the WIN32_SerialPort Class; WMI Code Creator will generate the code for you if you set the language (defaults to C#) and you can incorporate it into your program.

Hope that helps, good luck.


这篇关于使用IMEI号检测usb端口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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