Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.23 KB | None | 0 0
  1. static void Main(string[] args)
  2. {
  3.     string hostName = Dns.GetHostName();
  4.     IPHostEntry IPHost = Dns.GetHostByName(hostName);
  5.  
  6.     var IP = IPHost.AddressList[0].ToString();
  7.  
  8.     Console.WriteLine(IP);
  9.     Console.Read();
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement