View Full Version : VBScript - How to read text files without ASP
impala
03-20-2001, 03:12 PM
I am trying now to open a text file using the following code
Set filesys = CreateObject("Scripting.FileSystemObject")
Set filetxt = filesys.OpenTextFile(c:\"machinelist.txt", ForReading, true)
This code works fine on a local machine but when placed into a web page it cannot find the file. I would use MapPath but we do not want to use ASP and this will not work without it.
Any ideas?
jonirvine
03-25-2001, 04:10 AM
The code you are using already is ASP isn't it?
a_edwill
03-26-2001, 11:11 AM
First, I assume your code says:
Set filetxt = filesys.OpenTextFile("c:\machinelist.txt", ForReading, true)
Not
Set filetxt = filesys.OpenTextFile(c:\"machinelist.txt", ForReading, true)
correct?
Second, the file "machinelist.txt" does in fact exist on the server in the root, and not only on the client development machine?
If it does, does the createobject call fail on the server?
pixelmonkey
03-26-2001, 11:28 AM
why not add the file in a table using ssi? and ad contrast to the file from the base html or asp using css?
looking for back doors to crash into
chris<pixelmonkey>:D
impala
03-27-2001, 03:33 PM
First, no this is not ASP exactly. It is VBScript that is used in ASP. It is not working because we are not using ASP.
Second, yes sorry you are correct as to the syntax used.
Third, ok I will try to use ssi etc and I will see if I can get it to work.
Finally, thanks all for your input.
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.