How do I get my local IP in vb.net?
As a followup questions how would I connect to a remote computer like we could with the winsock control in VB.
I know I can use the winsock control, but I wanted to use the .Net framework.
Printable View
How do I get my local IP in vb.net?
As a followup questions how would I connect to a remote computer like we could with the winsock control in VB.
I know I can use the winsock control, but I wanted to use the .Net framework.
To get your local IP use:
Dim myIP As IPHostEntry = System.Net.Dns.Resolve(System.Net.Dns.GetHostName())
Then you can use for example:
label1.text = "My ip = " & myIP.AddressList(0).ToString
and here is a .net chat example not using winsock
http://msdn.microsoft.com/library/de...et08282001.asp