Advertisement
Guest User

Untitled

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