Click here to Skip to main content
11,928,605 members (55,429 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


4 bookmarked

Whats My IP Address ?

, 13 Sep 2011 CPOL
Rate this:
Please Sign up or sign in to vote.
Different Method(s) to Find IP Address?
Method 1

Imports System.Net

Dim _HostName As String = Dns.GetHostName

Dim _IPHostEntry As IPHostEntry = Dns.GetHostByName(_HostName)
For Each _IP As IPAddress In _IPHostEntry.AddressList
Method 2

Imports System.IO
Imports System.Text


Private Function GetInternetIPAddress() As String
Dim _ObjReq As HttpWebRequest = WebRequest.Create("")
Dim _ObjRes As HttpWebResponse = _ObjReq.GetResponse()
Dim _ObjStream As Stream = _ObjRes.GetResponseStream()
Dim _ObjSR As StreamReader = New StreamReader(_ObjStream)
Return _ObjSR.ReadToEnd()
Catch ex As Exception
   Return String.Empty
End Try
End Function


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


About the Author

Koshy Panicker John
Software Developer (Senior)
India India
No Biography provided

You may also be interested in...

Comments and Discussions

QuestionThanks so much Pin
afpfdv5-Apr-13 18:59
memberafpfdv5-Apr-13 18:59 
General doesn't work ... Pin
kiquenet AE21-Nov-11 21:30
memberkiquenet AE21-Nov-11 21:30 
GeneralReason for my vote of 4 Thanks for the Code lines. Pin
Member 432084427-Sep-11 9:24
memberMember 432084427-Sep-11 9:24 
GeneralReason for my vote of 4 Thanks. Pin
Member 432084427-Sep-11 9:15
memberMember 432084427-Sep-11 9:15 
GeneralReason for my vote of 3 good one Pin
Hemant K Mahajan27-Sep-11 4:46
memberHemant K Mahajan27-Sep-11 4:46 

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.

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.151126.1 | Last Updated 13 Sep 2011
Article Copyright 2011 by Koshy Panicker John
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid