ASP ReadAllメソッド
完全な TextStream オブジェクトリファレンス
ReadAll メソッドは TextStream ファイル全体を読み取り、文字列として結果を返します。
注意:このメソッドは大きなファイルには適していません(メモリリソースを浪費します)。
構文
TextStreamObject.ReadAll
例
<%
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!
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 オブジェクトリファレンス その他の拡張