如何检查端口是否已在使用中 [英] How to check if the port is already in use

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

问题描述

大家好,
我需要帮助.
我使用C ++ CURL库建立http连接:

但是我想检查某个端口是否已经在使用中.

我用谷歌搜索,但不幸的是找不到任何答案.

在此先谢谢您.

Hi Everybody,
I need help please.
I use C++ CURL library to make http connections:

But i wanted to check if the some port is already in use or not.

I googled it but unfortunately couldn''t find any answer.

Thanks in advance.

推荐答案

要检查Windows计算机上当前是否正在使用端口,请执行以下操作:
1)启动命令提示符.
2)在命令控制台中输入:
netstat -ano | findstr portNumber
这列出了行号中包含端口号的所有进程.
在行尾记下数字.这是进程ID(PID).
运行此PID的任务列表程序:
任务清单| findstr PID

还要检查 [
To check if a port is currently in use on a Windows machine:
1)Start Command Prompt.
2)In the command console enter:
netstat -ano | findstr portNumber
This lists any processes where the port number is included somewhere on the line.
Make a note of the number at the end of the line. This is the process ID (PID).
Run the task-list program for this PID:
tasklist | findstr PID

Also check This[^], it will help you.


这篇关于如何检查端口是否已在使用中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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