FSO Object (Write Access Issues)
From: Brian (lord03000_at_hotmail.com)
Date: 07/28/04
- Next message: Ken Schaefer: "Re: FSO Object (Write Access Issues)"
- Previous message: anonymous_at_discussions.microsoft.com: "Re: WshShell Access"
- Next in thread: Ken Schaefer: "Re: FSO Object (Write Access Issues)"
- Reply: Ken Schaefer: "Re: FSO Object (Write Access Issues)"
- Reply: Paul Lynch: "Re: FSO Object (Write Access Issues)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Tue, 27 Jul 2004 17:53:49 -0700
I have IIS 5.1 on Win XP Pro SP1. I'm trying to use ASP's
FSO Object to write to a file, but it never works.
Everytime I open the page, it just sits there, I wait and
wait, then it gives me an operation Timeout Message. I've
checked over the settings in IIS over and over again to
make sure I have write access, but for some reason it
just doesn't work.
Here is my ASP code
(C:\inetpub\wwwroot\lpctech\welcome.asp):
<%
'START OF CODE
Dim objFSO
Dim strPath
Dim intCount
strPath = Server.MapPath(strWritePath & "\hitCount.txt")
Set objFSO = Server.CreateObject
("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(strPath, ForReading,
True, TristateFalse)
intCount = int(objFile.ReadLine)
objFile.Close
intCount = intCount + 1
Set objFile = objFSO.OpenTextFile(strPath, ForWriting,
True, TristateFalse)
objFile.Write intCount
objFile.Close
'END OF CODE
%>
Explaination: What I'm trying to do here is a simple file
based hit counter.
strWritePath is a string set in include.asp which is
included in the file.
Here is what it is in there:
strWritePath = Server.MapPath(.\db)
Which translates to:
C:\Inetpub\wwwroot\lpctech\db
What the code does is open a file (hitcount.txt) which
just has a number. It reads that number, converts it into
an interger, increments it, and writes it back into the
file.
I've tested this script on my website (hosted by someone
else) and it works without a problem. It has a problem
with my computer.
If you have any idea what's wrong, please tell me.
email: lord03000@hotmail.com
Thanks in advance for any help.
- Next message: Ken Schaefer: "Re: FSO Object (Write Access Issues)"
- Previous message: anonymous_at_discussions.microsoft.com: "Re: WshShell Access"
- Next in thread: Ken Schaefer: "Re: FSO Object (Write Access Issues)"
- Reply: Ken Schaefer: "Re: FSO Object (Write Access Issues)"
- Reply: Paul Lynch: "Re: FSO Object (Write Access Issues)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|