Click here to Skip to main content
15,892,072 members
Articles / Programming Languages / Visual Basic
Alternative
Tip/Trick

Whats My IP Address ?

Rate me:
Please Sign up or sign in to vote.
3.40/5 (2 votes)
20 Sep 2011CPOL 11.1K   1   4
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)


Written By
CEO reew
Germany Germany
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
Generalhttp://automation.whatismyip.com/n09230945.asp fails ?? any ... Pin
kiquenet.com21-Nov-11 20:42
professionalkiquenet.com21-Nov-11 20:42 
GeneralRe: Try putting in the correct url. Your's is simply wrong. Pin
fjdiewornncalwe5-Dec-11 8:46
professionalfjdiewornncalwe5-Dec-11 8:46 
GeneralEdward, are you sure it woudl give you the "External" IP add... Pin
Archimedes2428-Sep-11 21:11
professionalArchimedes2428-Sep-11 21:11 
GeneralReason for my vote of 3 Not a great alternative - what if th... Pin
Ed Nutting28-Sep-11 7:38
Ed Nutting28-Sep-11 7:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.