How to get IP address of the browser when its operating behind a proxy/firewall? (applets...activex....??)
i have copied the code in my front page but it doesnt work. i dont have .asp setup.
Nov 23rd, 2006 22:39
Anzer M, Michael Scalise, Silvio Pedroso, Hari prasad, Qamar Ahmad, Built in ActiveX Problem in Windows XP
there are some problems with below ActiveX it wont work in two builds of
Windows XP. Details are
The components used
It works for all system except two. The specifications of the systems
are as follows:
IE version - 6
OS - Windows Xp Professional version
and Windows Xp Professional version 6.0.2900.2180.xpsp_sp2_gdr.050301-1519
The systems are configured exactly like the others. It seems that
something is restricting the Active X control from loading into the page.
Please let me know if there is any work around or patch to this problem...
(The solution above doesn't work. It retrieves only the public Ip
address, not the IPaddress on the PC behind the firewall/router. My
solution below does work, but it is a bit more complicated. Mike
This solution does retrieve IP addresses from behind a firewall. It
does have limitations. The client computer must be running Windows. It
requires ActiveX to be enabled in the browser.
The first file uses Windows Management Instrumentation (WMI) to
retrieve the physical address of your network card (MAC Address) and
the IP address currently assigned to that computer. Remember, if client
computer gets an address using DHCP, this Ip address may change daily.
The MAC address never changes. It is burned into your network card and
is supposed to be unique in the world. (In fact, microsoft uses the MAC
address and the curent date and time to generate GUID's. )
The first page does an asyncronous call to the WMI system. When the
async call it is done, then it then automatically posts the data to
another file which displayed the results. Nifty cool.
Copy and paste the two ASPFiles below.
The first ASP file- NIC5.ASP
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<title>WMI Scripting HTML</title>
<script FOR="foo" EVENT="OnCompleted(hResult,
pErrorObject, pAsyncContext)" LANGUAGE="JScript">
<script FOR="foo" EVENT="OnObjectReady(objObject,
if(objObject.IPEnabled != null && objObject.IPEnabled !
= "undefined" && objObject.IPEnabled == true)
if(objObject.MACAddress != null &&
objObject.MACAddress != "undefined")
MACAddr = objObject.MACAddress;
if(objObject.IPEnabled && objObject.IPAddress(0) !=
null && objObject.IPAddress(0) != "undefined")
IPAddr = objObject.IPAddress(0);
if(objObject.DNSHostName != null &&
objObject.DNSHostName != "undefined")
sDNSName = objObject.DNSHostName;
ID="info"> </span>. </FONT>
00600806D9B6" id="locator" VIEWASTEXT>
var service = locator.ConnectServer();
var MACAddr ;
var IPAddr ;
<form method="POST" action="NICPost.asp" id="formfoo" name="formbar">
<input type="hidden" name="txtMACAddr">
<input type="hidden" name="txtIPAddr">
<input type="hidden" name="txtDNSName">
This is the second file. It is an ASP page, but you could change it to
plain HTML and use Java to retrieve the form field values, if you
Network Interface Card Information Page
You are at IP Address <STRONG>
Your MAC address on your network card is <STRONG>
Your DNS Host name is <STRONG>
To confirm your IP and MAC address information, go to
the command prompt and
ASP reports that your IP Address is <STRONG>
</STRONG>which is your external WAN IP address that
anyone can see,
but maybe be shared by hundreds of users if you use Net
through a common router.
end of message