home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1997 March / VPR9703A.ISO / MS_DEV / VID / SERVER / ASF / DATA.Z / script3.asp < prev    next >
Text File  |  1996-10-22  |  986b  |  34 lines

  1. <CENTER>
  2.     <SCRIPT LANGUAGE="VBScript">
  3. <!--
  4. Sub CommandButton1_Click()
  5. Window.location.href = "atumd2.asp#UsingtheTextStreamComponent"
  6. end sub
  7. -->
  8.     </SCRIPT>
  9.     <OBJECT ID="CommandButton1" WIDTH=96 HEIGHT=32
  10.      CLASSID="CLSID:D7053240-CE69-11CD-A777-00DD01143C57">
  11.         <PARAM NAME="Caption" VALUE="Show Me">
  12.         <PARAM NAME="Size" VALUE="2540;847">
  13.         <PARAM NAME="FontCharSet" VALUE="0">
  14.         <PARAM NAME="FontPitchAndFamily" VALUE="2">
  15.         <PARAM NAME="ParagraphAlign" VALUE="3">
  16.     </OBJECT>
  17.  
  18.    <BR>
  19.        <%
  20.   On Error Resume Next
  21.  
  22.   Set InStream = Server.CreateObject("MS.TextStream")
  23.  
  24.   Randomize
  25.   TipNumber = Int(Rnd*10)
  26.   Instream.OpenTextFile Server.MapPath ("/advworks") + "\tips.txt", 1, FALSE, FALSE, FALSE
  27.   InStream.SkipLines(TipNumber)
  28.   TipOfTheDay = Instream.ReadLine
  29.   Instream.CloseTextFile
  30. %>
  31. <BR><FONT FACE="ARIAL NARROW" SIZE=4 COLOR="#800000"><STRONG>
  32. <%= TipOfTheDay %></STRONG></FONT>
  33. </CENTER>
  34.