Search Search

#1 worldwide
FREE Coding Lessons

since 1996
   THE BEST WAY to learn ASP & Asp.net!
Advertise Here!
click for details
Credits Host:
DiscountASP.net
Server Admin:
The "Team"
Contact Info.
Charles M. Carroll

my Blog
[prev. Lesson]  New Features in VBScript version5
     [next Lesson]  Text Files: Writing Them on Server

Text File Reading

   filename=/learn/test/txtread.asp

<Test Script Below>


<html><head>
<TITLE>txtread.asp</TITLE>
</head><body bgcolor="#FFFFFF">
<%
whichfile=server.mappath("/aspheader.asp")

Set fs = CreateObject("Scripting.FileSystemObject")
Set thisfile = fs.OpenTextFile(whichfile, 1, False)

counter=0
do while not thisfile.AtEndOfStream
    counter=counter+1
    thisline=thisfile.readline
    response.write thisline & "<br>"
loop

thisfile.Close
set thisfile=nothing
set fs=nothing
%>
</body></html>

There are many worthy charities!!. But perhaps help starving children in Africa or South America AND help Charles too. a $5 tip buys him lunch at McDonalds, a $20 tip buys his kid Hitoshi a new computer game, a $39 tip buys his daughter Michiko a few nice outfits. See our donor list.