查找已安装的串行端口? [英] find installed serial ports?

查看:78
本文介绍了查找已安装的串行端口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道一种简单的方法来获取计算机上所有可用(已安装)串行端口的列表的方法吗?我正在寻找一种在C语言中执行此操作的方法.我知道在C#中获取列表很简单,但是我需要一种在普通的旧C语言中工作的方法.

任何人想要帮助吗?

Does anyone know of a simple way to get a list of all the available (installed) serial ports on a machine? I''m looking for a way to do this in C. I know that in C# it''s a trivial matter to get the list, but I need a method to work in plain old C.

Anyone want to help?

推荐答案

此链接 [ ^ ]包含许多枚举串行端口(或其他伪装的方法)的方法因此).其中一些应该可以从普通的" C进行访问-只需查找基础的Win API调用即可.

祝你好运!

ps我发现的一个Vista陷阱是,要访问COM10到COM255(即1位数字),您需要使用"\\.\ COM nn "格式的管理员权限.要访问COM9之后的所有内容,必须使用此表单(至少在XP和更高版本上).不知道Weven,但是从M
This link[^] includes a number of methods of enumerating serial ports (or other things masquerading as such). Some of these should be accessible from "plain old" C - just look for the underlying Win API calls.

Good luck!

ps One Vista gotcha I found, is that to access COM10 to COM255 (i.e. >1 digit numbers), you need Administrator rights to use the "\\.\COMnn" form. This form is required (at least on XP and later) to access anything after COM9. Don''t know about Weven, but judging from M


对我的错误报告的不响应来看,我猜想它的行为就像Vista.
s non-response to my bug report, I''d guess it behaves like Vista.


这篇关于查找已安装的串行端口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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