-
Read text from textfile?
Hiya!
How do I, with ASP and FSO, read the text in a textfile? All dang tutorials are just showing me how to write to it, for crying out loud. :rolleyes:
I mean I want all the text in file.txt to go into the variable strText, for example.
Thankya in advance!
-
Code:
Set FileStreamObject = CreateObject("Scripting.FileSystemObject")
filename = BaseLocationForTextFiles & filename
Set TextOutput = FileStreamObject.OpenTextFile (filename,1,"FALSE")
While not TextOutput.AtEndOfStream
PrintOutput = TextOutput.ReadLine
If not TextOutput.AtEndOfStream Then
TextOutput.SkipLine()
End If
Wend
Set TextOutput = Nothing
Set FileStreamObject = Nothing
-
Works p e r f e c t ! Thanx! :D