Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / Languages / VB

Whats My IP Address ?

3.40/5 (2 votes)
20 Sep 2011CPOL 11.9K  
I find this useful:Dim st As System.IO.StreamDim sr As System.IO.StreamReaderDim req As System.Net.WebRequest = System.Net.WebRequest.Create(http://www.whatismyip.com/automation/n09230945.asp)Dim resp As System.Net.WebResponse = req.GetResponsest = resp.GetResponseStreamsr =...

I find this useful:


VB
Dim st As System.IO.Stream
Dim sr As System.IO.StreamReader

Dim req As System.Net.WebRequest = System.Net.WebRequest.Create("http://www.whatismyip.com/automation/n09230945.asp")
Dim resp As System.Net.WebResponse = req.GetResponse

st = resp.GetResponseStream
sr = New System.IO.StreamReader(st)
GetLocalIPAddress = sr.ReadLine.ToString

License

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