Solved

Some FrontPage (counter)

Posted on 1998-05-31
13
241 Views
Last Modified: 2013-12-25
Hi
I'm looking for a smart way to inspect some counters from a web site with FpExtensions. I have tryed to "include the cnt file into an HTML file... however this does'nt work. Also try to open that particular cnt file in the web browser does'nt work, even if I set the Netscape options to open the notepad.exe for files with cnt extension.

Also:
Does anyone have experience on running a larger number of counters (more than 100)  with Frontpage? If yes, is working in a proper way?

Cheers
Jörgen Aström
0
Comment
Question by:jastroem
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 6
13 Comments
 
LVL 1

Expert Comment

by:TAMC
ID: 1856880
The easiest way to do this would be to use some script, either javascript or vbscript, even better you could write asp, tell me which so I know which to write.
0
 

Author Comment

by:jastroem
ID: 1856881
Hi, and thank you for your answer.

Actually it doesn't matter in what way it is done...
What I want is to view just any kind of counter file (simple files only containg a number)
within my browser. If it's a script or an asp solution is not that important.

Please tell me how many points you expect for a "job" like that. And please also tell what you need to know about my server envirments.

Best wishes
jörgen Aström
0
 
LVL 1

Accepted Solution

by:
TAMC earned 100 total points
ID: 1856882
Well first of all if I am going to write this in ASP your server has to be running IIS 3.0 and has ASP installed, comment me back, and I'll start writing the ASP script.  I guess a 100 points will do.
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 1

Expert Comment

by:TAMC
ID: 1856883
Here, this worked on my machine, with IIS 3.0 and ASP installed, if this isn't up to your specs just comment me thanks.

Notes: change the line OpenTestFile("C:\boot.ini") to the path of the cnt file you want to open, also besides ReadAll there is ReadLine, and just Read, if you would rather use those, just comment me again.

<% @ LANGUAGE="VBSCRIPT" %>
<%
 OPTION EXPLICIT
 Dim file,filesystem,text
%>
<HTML>
<HEAD>
</HEAD>
<BODY>
<%
  Set filesystem = CreateObject("Scripting.FileSystemObject")
  Set file = filesystem.OpenTextFile("c:\boot.ini")
  text = file.ReadAll
  file.Close
  Response.Write text
%>
</BODY>
</HTML>
0
 

Author Comment

by:jastroem
ID: 1856884
I will try it. Tell me do just have to cut'n paste the code into an html file?
The problem might be the path to the files. Actually this is my main problem in some cgi I'm trying out right now... My server is a virtual server and it's so confusing to find out the proper way to my dierctorys. (it is a NT 4 Server IIS and I should be able to run ASP on it)

Thanks / Jörgen
0
 
LVL 1

Expert Comment

by:TAMC
ID: 1856885
What is in my answer is a whole file, it will work on its own.  If you want to incorporate it in to your own HTML file do this:

1) Put the following code at the top before anything else, again change boot.ini to the path of your file on the server if its in the same directory you can just put the file name(just like images):
   <% @ LANGUAGE="VBSCRIPT" %>
   <%
    OPTION EXPLICIT
    Dim file,filesystem,text
    Set filesystem = CreateObject ("Scripting.FileSystemObject")
    Set file = filesystem.OpenTextFile("c:\boot.ini")
   %>
2) Put the following code where you want to display the counter information.
   <% text = file.ReadAll
      Response.Write text %>
3) Put this when your done with the counter information
   <% file.Close %>
4) Rename the file to have an .asp extension (otherwise it won't work)
5) Put the file in a directory where you have read and execute rights(Might work in your cgi-bin directory?)
6) Hurray! should work, if not, comment again.

0
 

Author Comment

by:jastroem
ID: 1856886
I will try it. Tell me do just have to cut'n paste the code into an html file?
The problem might be the path to the files. Actually this is my main problem in some cgi I'm trying out right now... My server is a virtual server and it's so confusing to find out the proper way to my dierctorys. (it is a NT 4 Server IIS and I should be able to run ASP on it)

Thanks / Jörgen
0
 
LVL 1

Expert Comment

by:TAMC
ID: 1856887
Huh, your repeating yourself.
0
 

Author Comment

by:jastroem
ID: 1856888
I will try it. Tell me do just have to cut'n paste the code into an html file?
The problem might be the path to the files. Actually this is my main problem in some cgi I'm trying out right now... My server is a virtual server and it's so confusing to find out the proper way to my dierctorys. (it is a NT 4 Server IIS and I should be able to run ASP on it)

Thanks / Jörgen
0
 

Author Comment

by:jastroem
ID: 1856889
I will try it. Tell me do just have to cut'n paste the code into an html file?
The problem might be the path to the files. Actually this is my main problem in some cgi I'm trying out right now... My server is a virtual server and it's so confusing to find out the proper way to my dierctorys. (it is a NT 4 Server IIS and I should be able to run ASP on it)

Thanks / Jörgen
0
 

Author Comment

by:jastroem
ID: 1856890
I'm sorry I thought I could only reload this window to see if there's an "answer" from you.
Please forgive me for your unconvinence...
0
 

Author Comment

by:jastroem
ID: 1856891
Here's the result of my tests:

The server returns this (in German)
Laufzeitfehler in Microsoft VBScript-Fehler '800a004c'
Pfad nicht gefunden
/cgi-bin/test.asp, Zeile 6

It says Runtime Error in Microsoft...
path not found
/cgi-bin/test.asp, line6

And here's the asp doc (named test.asp):

<% @ LANGUAGE="VBSCRIPT" %>
<%
           OPTION EXPLICIT
           Dim file,filesystem,text
           Set filesystem = CreateObject ("Scripting.FileSystemObject")
           Set file = filesystem.OpenTextFile("_private/home.htm.cnt")
          %>
<html>

<head>
<title>TEST</title>
</head>

<body>
<% text = file.ReadAll
             Response.Write text %>
<% file.Close %>
</body>
</html>

___________________________

I have put the test.asp into my cgi-bin folder.

Any smart hints?

Thank you in advance
0
 
LVL 1

Expert Comment

by:TAMC
ID: 1856892
I will get back to you by the time EE says its 5:00 pm.
0

Featured Post

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

Learn by example how to specify CSS selectors for Selenium WebDriver test automation software.
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

617 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