C#如何在TCP中找到开放端口 [英] c# how to find open port in tcp

查看:188
本文介绍了C#如何在TCP中找到开放端口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网络项目.我正在手动给整数端口号(例如5656等),但是打开的端口可能会动态更改.因此,我需要找到可用于与远程主机连接的打开的端口.如何在C#中找到它.请提供帮助.请提前.

i have a network project.i am giving manually integer port numbers like 5656 etc. but the open ports may change dynamically.so i need to find the open port available for connection with the remote host. how to find that in c#. please help.Thx in advance.

推荐答案

请参阅:
http://stackoverflow.com/questions/570098/in-c-how-to-check-if-a-tcp-port-is-available [
see this:
http://stackoverflow.com/questions/570098/in-c-how-to-check-if-a-tcp-port-is-available[^]


这篇关于C#如何在TCP中找到开放端口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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