Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Web page that shows computer name and ip address

Posted on 2004-08-02
10
Medium Priority
?
647 Views
Last Modified: 2008-02-01
I am looking for a simple web page with ASP that a user would browse to that would show their computer name and IP.  I would like it to work with Win 9x if possible.

Thank you for any help,
Bill
0
Comment
Question by:bfisher666
  • 5
  • 3
  • 2
10 Comments
 
LVL 22

Expert Comment

by:neeraj523
ID: 11700856
Hello

This will give you the IP address of the machine opening asp page..

<%=Request.ServerVariables("REMOTE_ADDR")%>

Check for more varaibles..

http://www.webenalysis.com/servervariables.asp

neeraj523
0
 
LVL 7

Expert Comment

by:j2nku
ID: 11700869
You have a web server running on Win 9x??

http://telefonid.com/ipc.asp <- here is an example (it also has the function to get the country from the IP database)

Source of the file (i deleted the GetCountry function)

<%
yourip = Request.ServerVariables("REMOTE_HOST")
      ipaddr=Request.Servervariables("REMOTE_ADDR")
      set obj = CreateObject( "a1asp.dns" )
      host = obj.ReverseDNSLookup( cstr(ipaddr) )
      If len(host) > 0 Then ipaddr = host
      Set obj = nothing
%>Your IP is: <%=yourip%><br>
DNS returned: <%=ipaddr%><br><%
%>

I used here a1asp.dns to get the DNS for the IP address.
0
 

Author Comment

by:bfisher666
ID: 11700890
j2nku,
That is exactly what I wanted ... but .... I'm an idiot how do I wrap that into HTML ?

extreme novice,
Bill
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 22

Expert Comment

by:neeraj523
ID: 11700936
Hello

I don't think it is possible to resolve an IP Address without using any third party component to do so..

neeraj523
0
 

Author Comment

by:bfisher666
ID: 11700952
Is this how it is supposed to look?
----------------------------------
<html>
<head>
<title>IP Test</title>
</head>
<body bgcolor="#000000" text="#FFFFFF">
<%
yourip = Request.ServerVariables("REMOTE_HOST")
     ipaddr=Request.Servervariables("REMOTE_ADDR")
     set obj = CreateObject( "a1asp.dns" )
     host = obj.ReverseDNSLookup( cstr(ipaddr) )
     If len(host) > 0 Then ipaddr = host
     Set obj = nothing
%>Your IP is: <%=yourip%><br>
DNS returned: <%=ipaddr%><br><%
%>
</body>
</html>
0
 
LVL 7

Expert Comment

by:j2nku
ID: 11700968
bfisher, it's a server-side script - running on win2k3 and a1asp is a third-party COM component as neeraj said (it's possible, if i remember, to resolve DNS in .net?)

Only way i know how to show it in HTML is to use external provider (let's say - me at the moment)
and put into your HTML code the following line:

<iframe src="http://www.telefonid.com/ipc.asp" frameborder=0 scrolling=0 width=300 height=180>Iframe not supported!</iframe>

Of course, you can't use my file as a solution because you never know when i'm going to change it or remove it.

I suggest you - find a friend who has server running, ask him/her to write a short script for IP and DNS and include it to your page using iframe.
0
 
LVL 22

Expert Comment

by:neeraj523
ID: 11700972
Hello  bfisher666

if you have 'aiasp' component installed on ur wbe server.. than this code is fine and should work..

neeraj523
0
 
LVL 7

Expert Comment

by:j2nku
ID: 11700976
Yes, it's right, but now you must get a1asp.dns from somewhere - i know that a month ago i couldn't find it anymore from the internet (the download page was removed) but i may have it zipped somewhere on my hdd or server. I'll take a search.
0
 
LVL 7

Accepted Solution

by:
j2nku earned 2000 total points
ID: 11700997
Ok, i found it on my server and packed it (http://www.telefonid.com/a1asp.dns.rar)
Unpack it to let's say ... C:\Program Files\a1asp.dns
and then go to command line (on your server of course)
and write
regsvr32 "C:\Program Files\a1asp.dns\a1asp.dns.dll"

There is a readme also in the packed file.
0
 
LVL 7

Expert Comment

by:j2nku
ID: 11701012
I must warn you, i'm going to remove this file soon - i'm not sure if it is free to download and share in the internet.

But i hope the solution worked.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Integration Management Part 2
Suggested Courses

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question