Solved

Web page that shows computer name and ip address

Posted on 2004-08-02
10
590 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
 
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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 500 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

708 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now