查找使用端​​口的应用程序 [英] Find application using port

查看:120
本文介绍了查找使用端​​口的应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网络程序设置,做了很多的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屋!

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