ASP 읽기 방식


❮ 완전한 TextStream 객체 참조

Read 메서드는 TextStream 파일에서 지정된 수의 문자를 읽고 결과를 문자열로 반환합니다.

통사론

TextStreamObject.Read(numchar)

Parameter Description
numchar Required. The number of characters to read from the file

예시

<%
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)
%>

Output:

The first five characters are: Hello

❮ 완전한 TextStream 객체 참조