📌  相关文章
📜  c# 来自本地主机的 ipaddress - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:03.844000             🧑  作者: Mango

代码示例1
IPAddress address = Dns.GetHostAddresses("localhost").Where(x => x.AddressFamily == AddressFamily.InterNetwork).First();
Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
socket.Bind(new IPEndPoint(address, port));