Reading in a file using asp

I

Igor Zelfon

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
theFileReader.Close
Set theFileReader=Nothing
Set fileObj=Nothing

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

End If








%>


RATE IS: <%=rate%>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top