- ·上一篇文章:ASP编程中常用到的15个例子代码
- ·下一篇文章:如何使用asp去字符串中的超链接
fso显示文本文件的所有内容
asp利用fso来显示文本文件的所有内容的代码。注:1.txt为当前目录下的文本文件,如果要显示其他文本文件,需要更换地址。
<
%
Set 
MyFileObject=Server.CreateObject("
Scripting.FileSystemObject"
)
path=server.mappath("
1.txt"
)
Set 
MyTextFile=MyFileObject.OpenTextFile(path)
While 
NOT 
MyTextFile.AtEndOfLine
Response.Write(MyTextFile.Readline)&
#38
"
<
br>
"
WEND
MyTextFile.Close
%>
<
%
Set 
MyFileObject=Server.CreateObject("
Scripting.FileSystemObject"
)
path=server.mappath("
1.txt"
)
Set 
MyTextFile=MyFileObject.OpenTextFile(path)
While 
NOT 
MyTextFile.AtEndOfLine
Response.Write(MyTextFile.Readline)&
#38
"
<
br>
"
WEND
MyTextFile.Close
%>
fso显示文本文件的所有内容