Verbindungsinformationen auslesen (like Netstat.exe)
-
HAllo Leute, gibt es in .NET möglichkeiten aktuellen Verbindungen des PC's auszuelesen, so wie es netstat.exe es kann?
grüße
-
Hallo,
Quelle MSDN: http://msdn.microsoft.com/de-de/library/system.net.networkinformation.ipglobalproperties.getactivetcpconnections.aspx
Console.WriteLine("Active TCP Connections"); IPGlobalProperties properties = IPGlobalProperties.GetIPGlobalProperties(); TcpConnectionInformation[] connections = properties.GetActiveTcpConnections(); foreach (TcpConnectionInformation c in connections) { Console.WriteLine("{0} <==> {1}", c.LocalEndPoint.ToString(), c.RemoteEndPoint.ToString()); }
Alles weitere wohl bei IPGlobalProperties zu finden
Gruss
foodax