C# 用Socket怎么得到请求客户端的IP地址??

绑定连接的Socket中有个属性可取远程计算机IP

Socket newSocket = socket.Accept(); 
IPEndPoint clientipe = (IPEndPoint)newSocket.RemoteEndPoint;
Console.WriteLine("[" + clientipe.Address.ToString() + "] Connected");

 

相关文章:

  • 2021-08-14
  • 2021-11-30
  • 2022-02-27
  • 2022-12-23
  • 2021-12-15
猜你喜欢
  • 2021-08-17
  • 2021-12-14
  • 2022-12-23
  • 2022-01-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案