<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
http://www.corange.cn/archives/2008/10/1855.html
ASP读取一个文本文件,然后在特定的字符后面写入一段字符串的示例代码:
set fso=CreateObject("Scripting.FileSystemObject")
set f = fso.OpenTextFile(server.MapPath(文件路径))
if not f.atendofstream then
content=f.ReadAll
else
content=""
end if
f.close
set f=nothing
内容保存在content中.
本文介绍了一个使用ASP读取指定路径下文本文件并将其内容保存至变量的示例代码。通过创建Scripting.FileSystemObject对象,打开指定路径的文件,并读取全部内容。
1064

被折叠的 条评论
为什么被折叠?



