% ' Pick a tip between 1 and 70 to display in the page Randomize TipNumber = Int(Rnd*70) ' Open the file with the 70 tips in it Set FileObject = Server.CreateObject("Scripting.FileSystemObject") Set Instream = FileObject.OpenTextFile (Server.MapPath ("/") & "\anecdotas.txt", 1, FALSE, FALSE) ' Skip the tips before the tip you want to display in the page For i = 1 to TipNumber -1 InStream.SkipLine() Next ' Assign the variable TipOfTheDay to the tip randomly selected above Anecdotas = Instream.ReadLine %>
|
|