2014-10-20 105 views

回答

0

您可以使用System.Net.NetworkInformation.IPGlobalProperties对象检索所有现有连接:

Private Sub list_active_connections() 
    Dim _IPGlobalProperties As System.Net.NetworkInformation.IPGlobalProperties = System.Net.NetworkInformation.IPGlobalProperties.GetIPGlobalProperties() 
    For Each conn As System.Net.NetworkInformation.TcpConnectionInformation In _IPGlobalProperties.GetActiveTcpConnections 
     ListBox1.Items.Add(conn.RemoteEndPoint.ToString) 
    Next 
End Sub 
+0

感谢您的解决:d。但如何获得域的IP目的地如果可用:D – faisalakbar 2014-11-05 05:18:25

+0

@faisalakbar你可以尝试'Dns.GetHostEntry'(参见[this](http://stackoverflow.com/questions/3252845/how-to-get-域名从给定ip-in-c)回答) – Andrea 2014-11-05 07:41:58

+0

感谢您的解答:D – faisalakbar 2014-11-06 09:18:26

相关问题