C# 用Socket怎么得到请求客户端的IP地址??
绑定连接的Socket中有个属性可取远程计算机IP
Socket newSocket = socket.Accept();
IPEndPoint clientipe = (IPEndPoint)newSocket.RemoteEndPoint;
Console.WriteLine("[" + clientipe.Address.ToString() + "] Connected");
2022-04-12 10:34:23
绑定连接的Socket中有个属性可取远程计算机IP
Socket newSocket = socket.Accept();
IPEndPoint clientipe = (IPEndPoint)newSocket.RemoteEndPoint;
Console.WriteLine("[" + clientipe.Address.ToString() + "] Connected");