2014-10-20 108 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

相關問題