We can accomplish by using class Scripting.FileSystemObject.
Here, is an example.
<%
Dim objFileReader,objTxt
set objFileReader=Server.CreateObject("Scripting.FileSystemObject")
if objFileReader.FileExists(Server.MapPath("../SampleInv")& "\Terms.txt") then
set objTxt=objFileReader.OpenTextFile(Server.MapPath("../SampleInv")& "\Terms.txt",1)
strTerms=objTxt.ReadAll()
end if
%>
The above sample code reads Terms.txt file in location ../SampleInv of the web server and places the content in variable strTerms.
0 comments:
Post a Comment