|
-
Oct 1st, 2000, 08:17 PM
#1
Thread Starter
Hyperactive Member
I have some code here, and when I run it on my FTP server it says that it can't create the FileSystemObject, can someone please debug it for me? I've separated the buggy line from the rest to help.
Code:
<Script language="VBScript" RUNAT="Server">
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Dim Visitor, fso, MyFile, Data,
Set fso = CreateObject("Scripting.FileSystemObject")
Set MyFile = fso.OpenTextFile("testfile.txt", ForReading, True)
Data = MyFile.ReadLine
Visitor = CInt(Data)
Visitor = Visitor + 1
Document.Write "<h1>" & Visitor & "</h1>"
MyFile.Close
Set fso = CreateObject("Scripting.FileSystemObject")
Set MyFile = fso.OpenTextFile("testfile.txt", ForWriting, True)
MyFile.Write Visitor
MyFile.Close
</Script>
-
Oct 2nd, 2000, 07:06 AM
#2
Frenzied Member
FTP server??
with a few tweaks it runs on PWS ok.
Code:
<%@ Language=VBScript %>
<%option explicit%>
<HTML>
<BODY>
<%
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Dim Visitor, fso, MyFile, Data
Set fso = CreateObject("Scripting.FileSystemObject")
Set MyFile = fso.OpenTextFile("c:\testfile.txt", ForReading, True)
Data = MyFile.ReadLine
Visitor = CInt(Data)
response.Write "<h1>" & Visitor & "</h1>"
MyFile.Close
Visitor = Visitor + 1
Set fso = CreateObject("Scripting.FileSystemObject")
Set MyFile = fso.OpenTextFile("c:\testfile.txt", ForWriting, True)
MyFile.Write Visitor
MyFile.Close
%>
</BODY>
</HTML>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|