Quote:
What ever IPv4s I would get if I type in "netstat" in cmd.exe.
So
netstat[
^] used without parameters, displays active TCP connections.
Use
IPGlobalProperties.GetActiveTcpConnections Method[
^] to get all connections of your machine.
Imports System
Imports System.Net
Imports System.Net.NetworkInformation
Module Program
Sub Main()
Dim ipProperties As IPGlobalProperties = IPGlobalProperties.GetIPGlobalProperties()
Dim tcpConnections As TcpConnectionInformation() = ipProperties.GetActiveTcpConnections()
For Each info As TcpConnectionInformation In tcpConnections
Console.WriteLine("Local : " & info.LocalEndPoint.Address.ToString() & ":" & info.LocalEndPoint.Port.ToString() & vbLf & "Remote : " & info.RemoteEndPoint.Address.ToString() & ":" & info.RemoteEndPoint.Port.ToString() & vbLf & "State : " & info.State.ToString() & vbLf & vbLf)
Next
Console.ReadLine()
End Sub
End Module
You can use
AddressFamily[
^] property to filter connections for only IPv4 ones.