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

  1. <%@ LANGUAGE="JSCRIPT" %>
  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 that holds
  25.     // all the latest news headlines. 
  26.  
  27.     function GetChannelItems()
  28.     {
  29.         // Open FileList.txt to provide dynamic CDF information
  30.  
  31.         fso = Server.CreateObject("Scripting.FileSystemObject");
  32.         prFile = fso.OpenTextFile(Server.MapPath("FileList.txt"));
  33.  
  34.  
  35.         // Iterate through the file, dynamically creating CDF
  36.         // item entries
  37.  
  38.         while(!prFile.AtEndOfStream)
  39.         {
  40.  
  41.             // Get headline for item
  42.         
  43.             strTitle = prFile.ReadLine();
  44.  
  45.  
  46.             // Get URL of item
  47.         
  48.             strLink = prFile.ReadLine();
  49.  
  50.  
  51.             // Write CDF Item Tag
  52.             
  53.             Response.Write("<ITEM HREF=" + strLink + ">");
  54.             Response.Write("  <TITLE>" + strTitle + "!!!</TITLE>");
  55.             Response.Write("  <ABSTRACT>" + strTitle + "</ABSTRACT>");
  56.             Response.Write("</ITEM>");
  57.         }
  58.     }
  59. %>
  60.