Read file content line by line using ASP

by Nirmala 2009-08-20 11:08:12

Hi...
Use the below code to read file content line by line using ASP.
<%
Set fs=Server.CreateObject("Scripting.FileSystemObject")
Set f=fs.OpenTextFile(Server.MapPath("README.txt"), 1)

do while f.AtEndOfStream = false
Response.Write(f.ReadLine)
Response.Write("<br>")
loop

f.Close
Set f=Nothing
Set fs=Nothing
%>

Tagged in:

976
like
1
dislike
0
mail
flag

You must LOGIN to add comments