Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何获取连接到 c# 应用程序的客户端端口?
假设您有一个System.Net.Sockets.Socket对象,将其RemoteEndPoint属性类型转换为 anIPEndPoint然后读取其Port属性。
System.Net.Sockets.Socket
RemoteEndPoint
IPEndPoint
Port
要侦听套接字,您不需要先知道端口号吗?