Click here to Skip to main content
13,506,556 members
Click here to Skip to main content
Add your own
alternative version

Tagged as


4 bookmarked
Posted 13 Sep 2011

Whats My IP Address ?

, 13 Sep 2011
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 17:59
memberafpfdv5-Apr-13 17:59 
General doesn't work ... Pin
kiquenet AE21-Nov-11 20:30
memberkiquenet AE21-Nov-11 20:30 
GeneralReason for my vote of 4 Thanks for the Code lines. Pin
Member 432084427-Sep-11 8:24
memberMember 432084427-Sep-11 8:24 
GeneralReason for my vote of 4 Thanks. Pin
Member 432084427-Sep-11 8:15
memberMember 432084427-Sep-11 8:15 
GeneralReason for my vote of 3 good one Pin
Hemant K Mahajan27-Sep-11 3:46
memberHemant K Mahajan27-Sep-11 3: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.

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