Solved

Some FrontPage (counter)

Posted on 1998-05-31
13
226 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
  • 7
  • 6
13 Comments
 
LVL 1

Expert Comment

by:TAMC
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 1

Expert Comment

by:TAMC
Comment Utility
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
Comment Utility
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
Comment Utility
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:jastroem
Comment Utility
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
Comment Utility
Huh, your repeating yourself.
0
 

Author Comment

by:jastroem
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
I will get back to you by the time EE says its 5:00 pm.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Read about why website design really matters in today's demanding market.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

771 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

10 Experts available now in Live!

Get 1:1 Help Now