Scripting.FileSystemObject
Hi All,
I have a virtual directory in IIS called "Billing" and it points to
"D:\Billing" folder. It is outside of IIS drive.
If I try to open a PFD file in this folder, I can do it.
But I try to access a "Text" file to read it by using
"Scripting.FileSystemObject", it doesn't find the "Path" and gives an error. Here is my code;
<%
dim objFSO, objFileText, strPath, strLineText, strSourceFile
strSourceFile = "File1.txt"
strPath = "/Billing/" & strSourceFile
set objFSO = server.CreateObject("Scripting.FileSystemObject")
set objFileText = objFSO.OpenTextFile(strPath, 1, false)
' read one line at a time
do while not objFileText.AtEndOfStream
strLineText = objFileText.readline
response.Write strLineText
loop
set objFSO = nothing
set objFileText = nothing
%>
Thanks for your help,
:)
MCinar
Love all the creatures because of the creator.
__________________
MCinar
Love all the creatures because of the creator.
|