打开并读取某个文本文件

代码:

<!DOCTYPE html>

<html>

<body>

 

<%

Set FS = Server.CreateObject("Scripting.FileSystemObject")

Set RS = FS.OpenTextFile(Server.MapPath("text") & "\TextFile.txt",1)

While not rs.AtEndOfStream

      Response.Write RS.ReadLine

      Response.Write("<br>")

Wend

%>

 

<p>

<a href="text/textfile.txt"><img src="/images/btn_view_text.gif"></a>

</p>

 

</body>

</html>

结果:

相关文章