By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,925 Members | 732 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,925 IT Pros & Developers. It's quick & easy.

Reading in a file using asp

P: n/a
I have the following code in an asp that just seems to hang when executed.
When I disable the "Set theFileReader = fileObj.OpenTextFile(contentFile,1,True)"
line, I see that the file exists.
I am running this on Windows 2000 with IIS Server.
Any help would be appreciated


Dim fileObj, contentFile, textFileLoc, theFileReader, rate
Set fileObj = Server.CreateObject("Scripting.FileSystemObject")
textFileLoc = "blah.txt"
contentFile = Server.MapPath(textFileLoc)
If fileObj.FileExists(contentFile) then
Response.Write("File " + contentFile + " exists")
Set theFileReader = fileObj.OpenTextFile(contentFile,1,True)
rate = theFileReader.ReadLine
Set theFileReader=Nothing
Set fileObj=Nothing

Response.Write("File " + contentFile + " does not exist")

End If

RATE IS: <%=rate%>
Jul 19 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a

Ray at home

"Igor Zelfon" <ig*********> wrote in message
news:8c************************* m...
I have the following code in an asp that just seems to hang when executed.
Set fileObj = Server.CreateObject("Scripting.FileSystemObject")

Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.