讀取文本文件的所有行
代碼:
<!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)文章
- asp下生成目錄樹結(jié)構(gòu)的類
- 易心asp分頁類 v1.0
- ASPJPEG綜合操作的CLASS類
- ASP實現(xiàn)緩存類無錯版
- ASP里面令人震撼地Debug類(VBScript)
- ASP中類Class相關(guān)內(nèi)容的整理資料
- asp的通用數(shù)據(jù)分頁類
- ASP類的寫法
- VBS、ASP代碼語法加亮顯示的類
- 把無限級分類生成數(shù)組
- cls_main.asp第1/3頁
- MusicGet 類
- 查詢翻頁優(yōu)化第1/2頁
- 葉子asp分頁類
- Object對象的一些的隱藏函數(shù)介紹
- 在VBScript中使用類
- 代碼與頁面的分離
- 一個asp快速字符串連接類
- 如何編寫一個ASP類
- 表單集合的簡單應(yīng)用