扫描端口 [英] Scan Ports

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

问题描述

我想扫描我的本地端口并找到打开的端口。我怎么能在VB.Net中做到这一点?

I want to scan my local ports and find open ones. how can I do this in VB.Net??

推荐答案

您可以使用以下代码获取开放端口列表


You can use following code to get open port list

        
   Dim activeConnection() As System.Net.NetworkInformation.TcpConnectionInformation = System.Net.NetworkInformation.IPGlobalProperties.GetIPGlobalProperties.GetActiveTcpConnections
        Dim portList As New ArrayList
        For Each conn As System.Net.NetworkInformation.TcpConnectionInformation In activeConnection
            portList.Add(conn.LocalEndPoint.Port)
        Next





这篇关于扫描端口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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