Board index » Visual Studio » Input past end of file ???
|
Demmpa
|
Input past end of file ???
Visual Studio145
'***************** MAIN CODE BODY ******************** '************** declare page level variables ************ Const ForReading = 1 dim objFSO, objFile, strHTML, strPath If Request.ServerVariables("REQUEST_METHOD") = "POST" Then strPath = "c:\test.txt" 'request("dropdown2") set objFSO = CreateObject("Scripting.FileSystemObject") set objFile = objFSO.OpenTextFile(strPath, ForReading) strHTML = objFile.Readline response.Write("..." & strHTML & "...") End If '***************** END BODY CODE ******************** "c:\test.txt" ============= This is a Test Line 1 This is a Test Line 2 This is a Test Line 3 This is a Test Line 4 The end '**************************************************** Hi there, I am at a lost here. I have done numerous research and it looks like relatively straight forward to open a text file and read from it. I kept getting this error : Microsoft VBScript runtime error '800a003e' Input past end of file listings.asp, line 42 ===>strHTML = objFile.Readline Does anyone have any suggestion where did it go wrong ?? Appreciate any help. - |
