Socket clientSock = ServerSocket.Accpet();
接受客户端连接
DateTime connectTime = DateTime.Now;
连接一个客户端后,当前时间就是连接时间。
(clientSock.RemoteEndPoint as IPEndPoint).IPAddress;
ip地址
(clientSock.RemoteEndPoint as IPEndPoint).Port;
端口号
Socket socket = s.Accept();
IPAddress ip = ((IPEndPoint)socket.RemoteEndPoint).Address;
用SOCKET套接字,很简单就能做到