home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / iis4_07.cab / Code.asp < prev    next >
Text File  |  1997-11-01  |  1KB  |  50 lines

  1. <%
  2. Source=Request.QueryString("Source")
  3. %>
  4.  
  5. <HTML>
  6. <HEAD>
  7. <META NAME="DESCRIPTION" Content="FRAMESET Page for displaying sample ASP source code and output">
  8. <META NAME="GENERATOR" CONTENT="Microsoft Visual InterDev 1.0">
  9. <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso8859-1">
  10. <TITLE><%=Source%></TITLE>
  11. </HEAD>
  12.  
  13. <%If FileExists(Source) Then %>
  14.   <FRAMESET SCROLLING="YES" ROWS="*">
  15.     <FRAME SRC="CodeBrws.asp?source=<%=Source %>" NAME="CodeSource">
  16.   </FRAMESET>
  17.  
  18.   <BODY  BGCOLOR=#FFFFFF TOPMARGIN=0 LEFTMARGIN=0 ALINK=#23238E VLINK=#808080 LINK=#FFCC00>
  19.   <BASEFONT FACE="VERDANA, ARIAL, HELVETICA" SIZE=2>
  20.  
  21.   </BODY>
  22.  
  23. <%Else%>
  24.  
  25.   <BODY BGCOLOR=#FFFF9B TOPMARGIN=0 LEFTMARGIN=0 ALINK=#23238E VLINK=#228B22 LINK=#23238E>
  26.   <BASEFONT FACE="VERDANA, ARIAL, HELVETICA" SIZE=2>
  27.  
  28.   <CENTER><H1>The source code for this page could not be found.</H1>
  29.   </CENTER>
  30.   </BODY>
  31.  
  32. <%End If%>
  33.  
  34. </HTML>
  35.  
  36. <%
  37.   ' Function to determine if a file exists
  38.   Function FileExists(Source)
  39.     On Error Resume Next
  40.     
  41.     strFilename = Server.MapPath(Source)
  42.     Set FileObject = Server.CreateObject("Scripting.FileSystemObject")
  43.     
  44.     FileExists = False
  45.     
  46.     ' Attempt to open the file
  47.     Set oTempStream = FileObject.OpenTextFile(strFilename, 1, FALSE, TRUE )
  48.     If Err = 0 Then FileExists = True
  49.   End Function
  50. %>