After 2 hours of trying to do the simplest thing (finding the ip address of the local machine) and searching and searching but getting nowhere fast, I decided to ask my question here.
Apparently, System.Net.Dns.Resolve() is obsolete and I should use System.Net.Dns.GetHostEntry() instead.
I read that GetHostEntry() can simply be used instead of Resolve() as the paramaters and return types are the same but they're not.
Dim myHostName As String = System.Net.Dns.GetHostName()
Dim myIPAddress As String = System.Net.Dns.Resolve(myHostName).AddressList(0).ToString() returns "192.168.2.167" which is what I want.
Dim myIPAddress As String = System.Net.Dns.GetHostEntry(myHostName).AddressList(0).ToString() returns "fe80::112:6c34:8cc7:492d%10" which is Greek to me.
I gave up and left it using Resolve() but was hoping that someone could show me how to do it with a non-obsolete function.
Environment: VB.Net / Visual Studio 2010 / Windows Forms Application on Win 7 x64