如何确定哪个进程正在使用串行端口? [英] How do I determine which process is using a serial port?

查看:54
本文介绍了如何确定哪个进程正在使用串行端口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的公司生产通过串行端口与计算机通信的硬件.第三方公司编写与我们的硬件通信的软件.

The company I work for makes hardware that communicates to the computer though a serial port. Third party companies write software that communicates with our hardware.

有时我需要诊断我们的硬件.但是,当 Windows 启动时,第三方软件应用程序会连接到串行端口,从而阻止任何其他连接.我不知道此应用程序/服务的名称,而且也不总是相同的名称.

There are times when I need to diagnose our hardware. However, a third party software app connects to the serial port when Windows starts up, blocking any other connection. I don't know the name of this application/service and it's not always the same one.

有没有办法:

  • 查找当前使用给定串行端口的应用程序/服务的名称/pid 或
  • 从另一个应用窃取串行端口连接.

vb.net 最好,但我也会采用与语言无关的答案.

vb.net preferably, but I'll take a language agnostic answer as well.

推荐答案

您可以使用 process explorer 工具也来自 SysInternals,用于搜索打开的句柄.在这种情况下,您可能想要搜索Serial",因为它使用的设备名称可能无法映射到 com 端口号.(例如,COM1 在我的系统上是 \Device\Serial0).

You can use the process explorer tool also from SysInternals to search for open handles. In this case you would want to search for 'Serial' since it uses device names that may not map to com port numbers. (e.g. COM1 is \Device\Serial0 on my system).

如果你想从另一个应用程序控制串口,我认为你需要驱动程序的合作.

If you want to take control of the serial port from another app I think you would need co-operation of the driver.

这篇关于如何确定哪个进程正在使用串行端口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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