home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / iis4_07.cab / Tools_VBScript.asp < prev    next >
Text File  |  1997-10-25  |  2KB  |  93 lines

  1. <%@ LANGUAGE = VBScript %>
  2. <%  Option Explicit     %>
  3.  
  4.  
  5. <HTML>
  6.     <HEAD>
  7.         <TITLE>Tools Component</TITLE>
  8.     </HEAD>
  9.  
  10.     <BODY BGCOLOR="White" topmargin="10" leftmargin="10">
  11.  
  12.  
  13.         <!-- Display Header -->
  14.  
  15.         <font size="4" face="Arial, Helvetica">
  16.         <b>Tools Component</b></font><br>
  17.       
  18.         <hr size="1" color="#000000">
  19.  
  20.         <%
  21.             Dim Tools 
  22.             Dim FoundFile, FileExists, FileDoesNotExist, NotFoundFile
  23.             Dim RandInt, RandPosInt, RandIntBelow
  24.  
  25.             Set Tools = Server.CreateObject("MSWC.Tools")
  26.         %>
  27.     
  28.  
  29.         <h3> FileExists Example </h3>
  30.     
  31.         <%
  32.             FoundFile = "Tools_VBScript.asp"
  33.             NotFoundFile = "blah.asp"
  34.  
  35.     
  36.             ' Check if file exists
  37.     
  38.             FileExists = Tools.FileExists(FoundFile)
  39.  
  40.  
  41.             ' Output Response Appropriately
  42.  
  43.             If FileExists = TRUE Then 
  44.                 Response.Write "The File " & FoundFile & " Exists<BR>"
  45.             Else 
  46.                 Response.Write "The File " & FoundFile & " Does Not Exist<BR>"
  47.             End If
  48.  
  49.  
  50.             ' Check if file exists
  51.             
  52.             FileDoesNotExist = Tools.FileExists(NotFoundFile)
  53.  
  54.  
  55.             ' Output Response Appropriately
  56.         
  57.             If FileDoesNotExist = TRUE Then 
  58.                 Response.Write "The File " & NotFoundFile & " Exists"
  59.             Else 
  60.                 Response.write "The File " & NotFoundFile & " Does Not Exist"
  61.             End If
  62.         %>
  63.     
  64.  
  65.         <h3> Random Integer Example </h3>
  66.     
  67.         <%
  68.             ' Random Integer
  69.     
  70.             RandInt = Tools.Random
  71.             Response.Write "Random integer: "
  72.             Response.Write RandInt
  73.             Response.Write "<BR>"
  74.  
  75.     
  76.             ' Positive Random Integer
  77.             
  78.             RandPosInt = Abs( Tools.Random )
  79.             Response.Write "Positive random integer: "
  80.             Response.Write RandPosInt
  81.             Response.Write "<BR>"
  82.  
  83.             
  84.             ' Positive Random Integer between 0 and 100
  85.             
  86.             RandIntBelow =  Abs( Tools.Random ) Mod 100
  87.             Response.write "Random integer below 100: "
  88.             Response.write RandIntBelow
  89.             Response.write "<BR>"
  90.         %>
  91.     </BODY>
  92. </HTML>
  93.