如何找到特定的COM端口? [英] How do I find a specific COM Port?

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

问题描述

您好。

我正在开发一个带RFID阅读器的程序。我希望我的程序找到RFID阅读器连接的COM端口。但我找到的COM端口名称可能与我将程序安装到另一台计算机时的名称不同。例如,我现在使用COM17从我的计算机读取数据,但我可以使用COM3从另一台计算机上的同类读取器读取数据。



我怎么能自动找到阅读器的COM端口名称?

Hello.
I am developing a program with an RFID reader. I want my program to find the COM port which the RFID reader connected with. But the COM port name I found may not be the same as when I installed my program to another computer. For example, I use COM17 to read data from my computer now, but I may use COM3 to read data from the same kind reader on another computers.

How can I find the COM port name for the reader automatically?

推荐答案

请查看我对该问题的评论。



以下是这个想法:首先,找出可用的COM端口。具体方法如下: http:// msdn.microsoft.com/en-us/library/system.io.ports.serialport.getportnames%28v=vs.110%29.aspx [ ^ ]。



然后,检查每一个,看看RFID是否连接到任何一个。如何找到它?通过尝试。从您的RFID阅读器文档中了解它应该如何表现。



-SA
Please see my comment to the question.

Here is the idea: first, find out what COM ports are available. This is how: http://msdn.microsoft.com/en-us/library/system.io.ports.serialport.getportnames%28v=vs.110%29.aspx[^].

And then, examine each one to find out if the RFID is connected to any of them. How to find it out? By trying. Find out from your RFID reader documentation how it should behave.

—SA


这篇关于如何找到特定的COM端口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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