ASP Readメソッド
TextStream オブジェクトの完全なリファレンスマニュアル
Read メソッドは、TextStream ファイルから指定した文字数を読み取り、文字列として結果を返します。
構文
TextStreamObject.Read(numchar)
| パラメータ | 説明 |
|---|---|
| numchar | 必須です。ファイルから読み取る文字数を指定します。 |
例
<%
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.Read(5)
t.close
Response.Write("The first five characters are: " & x)
%>
出力:
The first five characters are: Hello
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.Read(5)
t.close
Response.Write("The first five characters are: " & x)
%>
出力:
The first five characters are: Hello
TextStream オブジェクトの完全なリファレンスマニュアル その他の拡張