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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting PC's IP Hostname + IP Address in VB?

Status
Not open for further replies.

LegoPiece

Programmer
Mar 19, 2001
95
US
Says it all really! However, it would be lovely to have the IP address and Hostname returned as a string. Are there any API calls, or open source examples for how to do this?

Thanks!
LeGo PiEcE

"The Computer Spock! Destroy it!" - Captain James T. Kirk
 
Drop a Winsock control on a page. In your code check its properties LocalHostName and LocalIP (or whatever they are).

As I recall you don't even need to do anything else with the control.
 
dilettante,

Yes it worked! It's kinda crazy when you rack your brains thinking that you need a billion Win32 API calls, then suddenly learn that the solution is simpler than you think! So thanks a million!

Thanks!
LeGo PiEcE

"The Computer Spock! Destroy it!" - Captain James T. Kirk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top