Click here to Skip to main content
15,921,351 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to access ip address of another machine on the network without using that machine
Posted
Comments
Dec90 22-Feb-13 6:24am    
question doesn't make sense. what are you trying to achieve?
ArunAmalraj 22-Feb-13 6:25am    
Just Ping the Host names in a command prompt

Finds IP Address of computer named "www.codeproject.com".

Dim strHostName As String = "www.codeproject.com"
Dim strIPAddress As String = ""
Dim objAddressList() As System.Net.IPAddress = _
    System.Net.Dns.GetHostEntry(strHostName).AddressList
For x = 0 To objAddressList.GetUpperBound(0)
    If objAddressList(x).AddressFamily = Net.Sockets.AddressFamily.InterNetwork Then
        strIPAddress = objAddressList(x).ToString
        Exit For
     End If
Next


Notes:
This code was tested on Visual Basic 2012 .NET Framework 4.0.

In earlier versions of the .NET Framework, there is a class named Dns.GetHostName but that has been deprecated and removed from the .NET Framework. Dns.GetHostEntry is the replacement.
 
Share this answer
 
v2
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900