查找使用端口的应用程序 [英] Find application using port
问题描述
我有一个网络程序设置,做了很多的nestat程序做什么。我上的netstat -o现在的工作。这个命令会给我使用套接字程序的PID。
我有哪里看一些想法。我一直在尝试使用WMI来获取该信息,但到目前为止,我还没有找到合适的类。
I have a networking program setup that does a lot of what the nestat program does. I am working now on netstat -o. That command will give me the PID of the program using that socket. I have some idea of where to look. I have been trying to use WMI to get that information but so far I have not found a suitable class.
我如何才能找到正在使用的PID或应用程序的名称尤其是插座?
How can I find the PID or application name that is using a particular socket?
我使用C#
推荐答案
据我所知,这信息未在BCL或WMI任何地方露出。你需要的P / Invoke GetExtendedTcpTable 一>得到它。
AFAIK, this information is not exposed anywhere in the BCL or WMI. You'll need to p/Invoke GetExtendedTcpTable to get it.
这篇关于查找使用端口的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!