Hi,
I am having problems writing to and reading text files using fso. No errors are evident except that the page starts to load but goes so slowly that nothing ever appears and I've never waited more than 10 mins. The same has happened for other attempts to write/read files on other asp pages.
I've checked the folder permissions and they seem ok.
Function resultString(initialString)
strLinetr = Trim(initialString)
intHowLong = Len(strLinetr)
intword = intHowLong - 6
endStr = Right(strLinetr, intword)
End Function
Dim connS, connD
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Const Create = False
Dim fso, ts,f, strLine, strFileName, counter
counter = 1
strFileName = Server.MapPath("results.txt"
set fso = server.CreateObject("Scripting.FileSystemObject"
set f = fso.GetFile(strFileName)
set ts = f.OpenAsTextStream(ForReading, -2)
If Not ts.AtEndOfStream Then
Do While Not ts.AtendOfStream
Select Case counter
Case 10
strLine = ts.ReadLine ' Read one line at a time
connS = resultString(strLine)
counter + 1
Case 11
strLine = ts.ReadLine ' Read one line at a time
connD = resultString(strLine)
counter + 1
Case Else
strLine = ts.ReadLine ' Read one line at a time
counter + 1
End Select
Loop
End If
ts.close
Hope someone can help as I am in desperate need of a solution
I am having problems writing to and reading text files using fso. No errors are evident except that the page starts to load but goes so slowly that nothing ever appears and I've never waited more than 10 mins. The same has happened for other attempts to write/read files on other asp pages.
I've checked the folder permissions and they seem ok.
Function resultString(initialString)
strLinetr = Trim(initialString)
intHowLong = Len(strLinetr)
intword = intHowLong - 6
endStr = Right(strLinetr, intword)
End Function
Dim connS, connD
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Const Create = False
Dim fso, ts,f, strLine, strFileName, counter
counter = 1
strFileName = Server.MapPath("results.txt"
set fso = server.CreateObject("Scripting.FileSystemObject"
set f = fso.GetFile(strFileName)
set ts = f.OpenAsTextStream(ForReading, -2)
If Not ts.AtEndOfStream Then
Do While Not ts.AtendOfStream
Select Case counter
Case 10
strLine = ts.ReadLine ' Read one line at a time
connS = resultString(strLine)
counter + 1
Case 11
strLine = ts.ReadLine ' Read one line at a time
connD = resultString(strLine)
counter + 1
Case Else
strLine = ts.ReadLine ' Read one line at a time
counter + 1
End Select
Loop
End If
ts.close
Hope someone can help as I am in desperate need of a solution