Click here to Skip to main content
13,552,325 members
Click here to Skip to main content
Add your own
alternative version

Tagged as


2 bookmarked
Posted 21 Sep 2011
Licenced CPOL

Whats My IP Address ?

, 21 Sep 2011
Private Sub GetIPAddress()Dim strHostName As StringDim strIPAddress As StringstrHostName = System.Net.Dns.GetHostName()strIPAddress = System.Net.Dns.Resolve(strHostName).AddressList(0).ToString()MessageBox.Show("Host Name: " & strHostName & "; IP Address: " &...


Members may post updates or alternatives to this current article in order to show different approaches or add new features.

22 Sep 2011
On Vista/Win 7, I have seen code where only a single period is returned for (0). This makes sure you get the actual IP regardless of the system.Const IPPattern As String = "^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$"With Dns.GetHostEntry(System.Environment.MachineName) Return...
18 Nov 2011
protected void Page_Load(object sender, EventArgs e){ HttpBrowserCapabilities bc = Request.Browser; Label1.Text = "IP Address=" + Request.UserHostAddress;}
24 Nov 2011
Dim ipE As System.Net.IPHostEntry = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName) Dim AL As Array = Dns.GetHostEntry(vWrkStn).AddressList Dim A As IPAddress For Each A In AL If A.AddressFamily = Sockets.AddressFamily.InterNetwork Then ...
14 Sep 2011
Mohammad A Rahman
namespace IpAddresses{ using System; using System.Collections.Generic; using System.Linq; using System.Net; class Program { static void Main(string[] args) { GetIPAddresses().ForEach(ip => Console.WriteLine(ip)); } ...
13 Sep 2011
Koshy Panicker John
6 alternatives  
Different Method(s) to Find IP Address?
20 Sep 2011
I find this useful:Dim st As System.IO.StreamDim sr As System.IO.StreamReaderDim req As System.Net.WebRequest = System.Net.WebRequest.Create("")Dim resp As System.Net.WebResponse = req.GetResponsest = resp.GetResponseStreamsr =...


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


About the Author

Anshul R
India India
No Biography provided

| | Privacy | Terms of Use | Mobile
Web02-2016 | 2.8.180515.1 | Last Updated 22 Sep 2011
Article Copyright 2011 by Anshul R
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid