Answer the question
In order to leave comments, you need to log in
WITH#. How to get a specific IP starting with 10 from a List System.Net.Dns.GetHostEntry(hostname).AddressList object?
Good afternoon!
I get a List of addresses using System.Net.Dns.GetHostEntry(hostname).AddressList, there are a lot of ipv6 addresses, addresses like 192.168.XX and among them there is one 10.XXX
How to get it from the list?
Thanks in advance!
Answer the question
In order to leave comments, you need to log in
System.Net.Dns.GetHostEntry("ya.ru").AddressList.First( x=>x.Address.ToString().StartsWith("10"))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question