Get All IP Addresses on Machine

前端 未结 6 651
北恋
北恋 2020-12-01 17:55

How can I get all of the IP addresses attached to the machine that my application (C# NET Console app) is running on? I need to bind a WCF service to the primary IP address,

6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-01 18:47

    I think the OP is asking about how to get all addresses on a local NIC, not just those addresses known to DNS. By primary he probably means the main address under "use the following IP address" in the adapter properties, and by "the rest" he probably means those listed in Advanced > (Additional) IP Addesses.

    DNS will not necessarily know those.

提交回复
热议问题