讀取文本文件的所有行

代碼:

<!DOCTYPE html>

<html>

<body>

<p>This is all the lines in the text file:</p>

 

<%

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

Set f=fs.OpenTextFile(Server.MapPath("testread.txt"), 1)

 

do while f.AtEndOfStream = false

Response.Write(f.ReadLine)

Response.Write("<br>")

loop

 

f.Close

Set f=Nothing

Set fs=Nothing

%>

 

</body>

</html>

結(jié)果:

This is all the lines in the text file:

Hello!
How are you today?

相關(guān)文章
亚洲国产精品第一区二区,久久免费视频77,99V久久综合狠狠综合久久,国产免费久久九九免费视频