Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

My IP Address

Status
Not open for further replies.

DotNetNewbie

Programmer
Joined
Mar 3, 2004
Messages
344
Location
GB
Hi,

Ive looked around the net and found a few solution however none realy work well or even work for that matter.

I just want some basic code to return the IP address of the computer the program is ran on. its a windows app and the output should be to a textbox.

If anyone can help me I would be eternaly welcome.

D.
 
Typical,

As soon as I post im able to do it myself.

Thanks for your time everyone.

D.
 
shortest one, I found.

Code:
Me.lblIPadress.Text = System.Net.Dns.GetHostByName(Environment.MachineName).AddressList(0).ToString

Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top