TcpConnectionInformation Class
.NET Framework 2.0
Note: This class is new in the .NET Framework version 2.0.
Provides information about the Transmission Control Protocol (TCP) connections on the local computer.
Namespace: System.Net.NetworkInformation
Assembly: System (in system.dll)
Assembly: System (in system.dll)
The following example displays endpoint information for active TCP connections.
public static void GetTcpConnections() { IPGlobalProperties properties = IPGlobalProperties.GetIPGlobalProperties(); TcpConnectionInformation[] connections = properties.GetActiveTcpConnections(); foreach (TcpConnectionInformation t in connections) { Console.Write("Local endpoint: {0} ",t.LocalEndPoint.Address); Console.Write("Remote endpoint: {0} ",t.RemoteEndPoint.Address); Console.WriteLine("{0}",t.State); } }
Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.