Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- IPHostEntry ipHostEntry = Dns.GetHostEntry(ipString); // any ip string from external service, e.g. "localhost"
- IPAddress[] ipAddresses = ipHostEntry.AddressList; // count is 2. second is 127.0.0.1
- IPAddress ipAddress = ipAddresses.First(); // {::1}
- // Ip address will be something like http://[::1]:1234
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement