dynamicrevolutions
asked on
How to get server or localhost address in VB.net Win32 application.
Hi..
How do i get a server IP address in VB.net win32 application.
Thanks !
How do i get a server IP address in VB.net win32 application.
Thanks !
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
hey..
check if this is what you are looking for..
Dim ip As System.Net.IPHostEntry
ip = System.Net.Dns.GetHostByNa me("<serve r name>")
MsgBox(ip.AddressList(0).T oString) 'will display the first IP assigned
you might hav eto add error checks
Enjoy!
Pratap
check if this is what you are looking for..
Dim ip As System.Net.IPHostEntry
ip = System.Net.Dns.GetHostByNa
MsgBox(ip.AddressList(0).T
you might hav eto add error checks
Enjoy!
Pratap
oops.. sorry guys.. i din't notice your posts..
try this...
Import System.Net
Dim ipEntry As IPHostEntry = Dns.GetHostByName(Environm
Dim IpAddr As IPAddress() = ipEntry.AddressList
Dim i As Integer
'A hostmachine can have more than one IP assigned
Me.Label2.Text = IpAddr(0).ToString()
-bhpr