ASP ReadAll 方法
完整的 TextStream 對(duì)象參考手冊(cè)
ReadAll 方法可讀取整個(gè) TextStream 文件,并以字符串返回結(jié)果。
注意:此方法不適合大型文件(會(huì)浪費(fèi)內(nèi)存資源)。
語法
實(shí)例
<%
dim fs,f,t,x
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.CreateTextFile("c:\test.txt"")
f.write("Hello World!")
f.close
set t=fs.OpenTextFile("c:\test.txt"",1,false)
x=t.ReadAll
t.close
Response.Write("The text in the file is: " & x)
%>
輸出:
The text in the file is: Hello World!
完整的 TextStream 對(duì)象參考手冊(cè)
更多建議: