<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> Infra-Metals Co. SteelDay 2009 Information <% 'Create session variables if not request.QueryString("path") = "" then session("folder") = request.QueryString("folder") 'folder currently viewing session("CPath") = request.QueryString("path") 'complete path to the text file user is viewing end if function getContents(dir) ' declare variables dim fso, fsodir, ourDir, ourItem ' declare the folder ourDir = dir ' prepare the system variables Set fso = Server.CreateObject("Scripting.FileSystemObject") Set fsodir = fso.GetFolder(Server.MapPath(ourDir)) ' loop through the sub directories dim i,subpath i = 1 for each ourItem in fsodir.SubFolders subpath = Dir&"/"&ourItem.Name&"&folder="&ourItem.Name response.write("
  • " & Replace(UCase(ourItem.Name),"_"," ")& "
  • ") i = i + 1 next ' loop through the files for each ourItem in fsodir.Files response.write("
  • "&Replace(Replace(UCase(ourItem.name),".TXT", ""),"_", " ")&"

  • ") next ' clean up server variables Set ourItem = nothing Set fsodir = nothing Set fso = nothing end function function getItems() if not session("CPath") = "" then 'Current path selection Saved in session variable response.Write("
    ") getContents(session("CPath")) if not request.QueryString("p") = "" then 'variable to hold the name of the file dim strN 'hold the current file in form field for later use response.Write("") strN = replace(request.QueryString("n"),"_", " ") 'remove the underscores in the file strN = replace(strN,".txt", "")'remove the file extentsion response.Write("

    JOB DESCRIPTION: "& UCase(strN) & "

    ") ' Set up constants Const ForReading = 1 Const Create = False ' Declare local variables Dim objFSO ' FileSystemObject Dim TS ' TextStreamObject Dim strLine ' local variable to store Line Dim strFileName ' local variable to store fileName strFileName = Server.MapPath(request.QueryString("p")) ' Instantiate the FileSystemObject Set objFSO = Server.CreateObject("Scripting.FileSystemObject") ' use Opentextfile Method to Open the text File Set TS = objFSO.OpenTextFile(strFileName, ForReading, Create) If Not TS.AtEndOfStream Then Do While Not TS.AtendOfStream Response.Write("
    ") strLine = TS.ReadLine ' Read one line at a time Response.Write strLine ' Display that line Response.Write "
    " Response.Write("
    ") Loop End If ' close TextStreamObject ' and destroy local variables to relase memory TS.Close Set TS = Nothing Set objFSO = Nothing end if response.Write("

    ") end if end function %>
    Infra-Metals Co. SteelDay 2009 Location Information

    Baltimore, MD

    Hallandale, FL

    Marseilles,IL

    Petersburg, VA

    Tampa, FL

    Wallingford, CT