I am simply trying to open a txt file and read the contents of it from VBscript on my webpage. Can anyone help with this one? I get no results out on the msgbox.
Mike
p.s. vfile = "\\server\folder\filename.txt"
Function GetTEXT
On Error Resume Next
Dim fso4
Dim txfile
Dim fts
Dim ftext
err.clear
Set fso4 = CreateObject("Scripting.FileSystemObject"
If (fso4.FileExists(vfile)) Then
' Verification File Exists and We need to Read it...
Set txfile = fso4.OpenTextFile(vfile)
Set fts = txfile.OpenAsTextStream(ForReading)
ftext = fts.readline
MsgBox(ftext)
fts.Close
set txfile = nothing
set fso4 = nothing
Else
' File Doesn't Exist.
Alert("Unable to OPEN: No File Exists."
Exit Function
End If
End Function