<html>
<head>
<httpequiv=ContentType content=text/html; charset=gb>
<title></title>
</head>
<body>
<% LANGUAGE = VBScript % >
<%
Const ForReading = ForWriting = ForAppending =
Const TristateUseDefault = TristateTrue = TristateFalse =
Dim filename
filename = testtxt 缺省相对路径是c:winnt
Set fs = CreateObject(ScriptingFileSystemObject)
Set f = fsGetFile(filename)
Set readf = fOpenAsTextStream(ForReadingTristateFalse)
第一个参数可选输入/输出模式是下列三个常数之一
ForReading=只读ForWriting= 可读写或 ForAppending=追加
第二个参数也为可选三个 Tristate 值之一
指出以何种格式打开文件忽略此参数则文件以 ASCII
格式打开 TristateUseDefault= 以系统默认格式打开文件
TristateTrue= 以 Unicode 格式打开文件或TristateFalse=
以 ASCII 格式打开文件
也可用OpenTextFile方法打开文件
s = readfReadLine
Do While readfAtEndOfLine <> True
s = readfReadLine
Responsewrite s & 逐行读文件并写出
Loop
readfclose
%>
</body>
</html>