如何在我的本地机中捕获可用端口 [英] How to Capture available ports in my local maching

查看:62
本文介绍了如何在我的本地机中捕获可用端口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以告诉我如何捕获本地计算机上的可用端口,该端口应与我的设备管理器匹配.

Can anybody tell me how to capture the available port in my local machine, which should match with my device manager.

推荐答案

您可以使用SerialPort.GetPortNames [
You can use SerialPort.GetPortNames[^] which returns array of serial port names for the current computer.


您的意思是扫描开放端口吗?如果是这样,您将不得不尝试一个一个地连接到每个端口.

我不确定与设备管理器匹配"是什么意思.
Do you mean scan for open ports? If so you''d have to try connecting to each port one by one.

I am not sure what you mean by "match with device manager".


这篇关于如何在我的本地机中捕获可用端口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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