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

  1. <%@ LANGUAGE="VBSCRIPT" %>
  2. <%  Response.ContentType = "application/x-cdf" %>
  3.  
  4. <?XML version="1.0"?>
  5.  
  6. <CHANNEL HREF="http://www.microsoft.com/">
  7.  
  8.     <TITLE>IIS SDK CDF Test</TITLE>
  9.     <ABSTRACT>CDF file with ASP</ABSTRACT>
  10.  
  11.     <SCHEDULE>
  12.         <INTERVALTIME HOUR="1" />
  13.     </SCHEDULE>
  14.  
  15.     <%
  16.         GetChannelItems
  17.     %>
  18.  
  19. </CHANNEL>
  20.  
  21.  
  22. <%
  23.     ' GetChannelItems uses the FileSystem Object
  24.     ' to access a file on the server which holds
  25.     ' all the CDF items. 
  26.  
  27.     Sub GetChannelItems
  28.  
  29.         On Error Resume Next
  30.         Dim fso, prFile, strTitle, strLink,strCategory
  31.  
  32.  
  33.         ' Open FileList.txt to provide dynamic CDF information
  34.  
  35.         Set fso = Server.CreateObject("Scripting.FileSystemObject")
  36.         Set prFile = fso.OpenTextFile(Server.MapPath("FileList.txt"))
  37.  
  38.         If Err.Number <> 0 Then
  39.             Exit Sub
  40.         End If
  41.         
  42.         
  43.         ' Iterate through the file, dynamically creating CDF item entries
  44.  
  45.         Do Until prFile.AtEndOfStream
  46.         
  47.             ' Get headline
  48.  
  49.             strTitle = prFile.ReadLine
  50.  
  51.  
  52.             ' Get URL
  53.  
  54.             strLink = prFile.ReadLine
  55.  
  56.  
  57.             ' Write CDF Item tag back to Browser
  58.  
  59.             Response.Write("<ITEM HREF=" & strLink & ">")
  60.             Response.Write("  <TITLE>" & strTitle & "!!!</TITLE>")
  61.             Response.Write("  <ABSTRACT>" & strTitle & "</ABSTRACT>")
  62.             Response.Write("</ITEM>")
  63.         Loop
  64.  
  65.     End Sub
  66. %>
  67.