Textstream test

<% Set FileObject = Server.CreateObject("Scripting.FileSystemObject") TestFile = Server.MapPath ("/ASPSamp") & "\samples\tsworks.txt" Set OutStream= FileObject.CreateTextFile (TestFile, TRUE, FALSE) OutputString = "This is a test..." & Now() OutStream.WriteLine OutputString Response.Write "Wrote the string '" & OutputString & "' to the file: '" & TestFile & "'

" Set OutStream = Nothing Response.Write "Reading from file '" & TestFile & "':
" Set InStream= FileObject.OpenTextFile (TestFile, 1, FALSE, FALSE) While not InStream.AtEndOfStream Response.Write Instream.Readline & "
" InStream.SkipLine() wend Set Instream=nothing Randomize TipNumber = Int((10 - 1 + 1) * Rnd + 1) Response.Write "

The Tip Number is: " & TipNumber & "

" strtipsfile = (Server.MapPath("/advworks") + "\tips.txt") Set InStream = FileObject.OpenTextFile (strtipsfile, 1, FALSE, FALSE) while TipNumber > 0 InStream.SkipLine() TipNumber = TipNumber-1 wend TipOfTheDay = Instream.ReadLine Response.Write "The Tip of the Day is:
" & TipOfTheDay & "" Set InStream = Nothing %>