using System.Net;
 
 
IPHostEntry he = Dns.GetHostByName(Dns.GetHostName());
Text = he.AddressList[0].ToString(); // returns IP address

Well, this will return multiple IP addresses if you have multiple IPs (multiple ethernet cards etc.)

VN:F [1.1.6_502]
Rating: 0.0/5 (0 votes cast)
Share:
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • DotNetKicks
  • LinkedIn
  • Live
  • MySpace
  • StumbleUpon
  • Technorati

Related posts:

  1. Is your windows is 32 or 64 bit?
  2. Hello World - Python application for Windows with Tk.
  3. Build DateTime from values
  4. Find your lucky number in c#
  5. Sum of even valued numbers in Fibonacci series