Getting the IP Address of a Remote Socket Endpoint

后端 未结 4 533
温柔的废话
温柔的废话 2020-12-03 00:58

How do I determine the remote IP Address of a connected socket?

I have a RemoteEndPoint object I can access and well as its AddressFamily member.

How do I ut

4条回答
  •  南笙
    南笙 (楼主)
    2020-12-03 01:18

    string ip = ((IPEndPoint)(testsocket.RemoteEndPoint)).Address.ToString();
    

提交回复
热议问题