Latest web development tutorials

ASP Write Method

TextStream Object Reference Complete TextStream Object Reference

Write method to write the specified text to a TextStream file.

Note: This method to TextStream file written text does not include a space between each string or line.

grammar

TextStreamObject.Write(text)

参数 描述
text 必需的。写入文件的文本。

Examples

<%
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.CreateTextFile("c:\test.txt",true)
f.write("Hello World!")
f.write("How are you today?")
f.close
set f=nothing
set fs=nothing
%>

在执行上面的代码后,文件 test.txt 如下所示:

Hello World!How are you today?


TextStream Object Reference Complete TextStream Object Reference