自强学堂
自强学堂:学习、分享、让你更强!
ASP 实例HTMLCSSJAVASCRIPTJQUERYSQLPHPBOOTSTRAPANGULARXML
 

ASP Read 方法

TextStream 对象参考手册 完整的 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


TextStream 对象参考手册 完整的 TextStream 对象参考手册