%@ Language=VBScript %> <% Option Explicit %> <% 'Expire!! Response.ExpiresAbsolute = Now() - 1 'The name of our help index file Const HelpIndex = "helpIndex.txt" 'FSO constants Const ForReading = 1 'We want to create one instance of a FileSystemObject Dim fso Set fso = Server.CreateObject("Scripting.FileSystemObject") 'This will be our file textstream variable Dim fileTextStream %>
|
<% 'This will hold the URL and Title Dim strURL, strTitle 'Make sure the text file exists If Not fso.FileExists(Server.MapPath(HelpIndex)) then 'Tell the user we can't find the help file... Response.Write "The help index file could not be located." else 'Open our help index file and show links to all of our 'help files... Set fileTextStream = fso.OpenTextFile(Server.MapPath(HelpIndex),ForReading) While Not fileTextStream.AtEndOfStream strTitle = fileTextStream.ReadLine strURL = fileTextStream.ReadLine Response.Write " " & vbCrLf Wend fileTextStream.Close end if %> |
<% 'Now, we need to determine what file to load Dim strFileName strFileName = Request.QueryString if Len(strFileName) = 0 then 'No querystring passed in, show default index %> Welcome to the help system! Choose a topic you want help on from the list on the left! <% else If Not fso.FileExists(Server.MapPath(strFileName)) then 'Tell the user we can't find the help file... Response.Write "The help file " & strFileName & " could not be located." else Set fileTextStream = fso.OpenTextFile(Server.MapPath(strFileName),ForReading) Response.Write fileTextStream.ReadAll end if end if %> |