Alternatives
Members may post updates or alternatives to this current article in order to show different
approaches or add new features.
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 2011Denno.Secqtinstien
protected void Page_Load(object sender, EventArgs e){ HttpBrowserCapabilities bc = Request.Browser; Label1.Text = "IP Address=" + Request.UserHostAddress;}
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 2011Mohammad 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 2011Koshy Panicker John 6 alternatives
Different Method(s) to Find IP Address?
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 =...
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.