<%@ LANGUAGE="VBSCRIPT" %> <% Option Explicit %> <% On Error Resume Next Dim f, strDisplay, conn, Description, fc, fl, y, FileName, _ posFile, g, rs, sql, machine '----------Localization Variables----------------- Dim bckSlash, colon, semiColon, period, locMyPubFiles, locHome, _ locK, locSize, locDescription bckSlash = chr(92) colon = chr(58) semiColon = chr(59) period = chr(46) locMyPubFiles = "My Published Files" locHome = "Home" locK = " KB" 'File Size locSize = "Size " '---------------Run Subs-------------- setSysObj readDescriptions '---------------Subs------------------ Sub setSysObj Set FileSystem=CreateObject("Scripting.FileSystemObject") Dim root, FileSystem, g, sc root = server.mappath(bckSlash) root = Trim(Left(root, instrRev(root, bckSlash))) root = root + "webpub" g = FileSystem.GetAbsolutePathName(root) Set f=FileSystem.GetFolder(g) Set sc = f.SubFolders End Sub Sub readDescriptions 'Read all file descriptions in publish.mdb Dim strProvider, sql, rs, n, i strProvider="DRIVER=Microsoft Access Driver (*.mdb); DBQ=" & Server.MapPath(bckSlash + "iisadmin") & bckSlash + "publish" + bckSlash + "publish.mdb" + semiColon Set conn = Server.CreateObject("ADODB.Connection") conn.open strProvider,"","" sql = "SELECT FileList.FileName, FileList.FileDescription, FileList.FilePath FROM FileList ORDER BY FileList.FileName" Set rs = Server.CreateObject("ADODB.Recordset") rs.Open sql, conn, 3, 3 If not rs.EOF Then rs.movelast n = rs.recordcount - 1 rs.movefirst For i = 0 to n strDisplay = strDisplay + rs.Fields("FileName").Value + " " + rs.Fields("FileDescription").Value + semiColon rs.movenext Next End If End Sub %> <% call stylesheet Function writeFiles() DIM strFiles, FileSize 'Read all file names in WebPub Set fc = f.Files strFiles = "" g = ".." + bckSlash + ".." + bckSlash + "webpub" + bckSlash For Each fl in fc y = y + 1 FileName=fl.name If strDisplay <> "" Then posFile=instr(Ucase(strDisplay), Ucase(FileName)) If posFile <> 0 Then Set rs = Server.CreateObject("ADODB.Recordset") sql = "SELECT FileList.FileName, FileList.FileDescription, FileList.FilePath FROM FileList WHERE FileList.FileName ='" + FileName + "'" rs.Open sql, conn, 3, 3 Description = rs.Fields("FileDescription").Value Else Description = "" End If End If If y Mod 2 <> 0 Then strFiles = strFiles & "" End If FileSize = Int((fl.size/1024) + .5) strFiles = strFiles & "" If y Mod 2 = 0 Then strFiles = strFiles & "" End If Next strFiles = strFiles & "
  " strFiles = strFiles & "" & fl.name & "
" & locSize & FileSize & locK & "
" & Description & "
" writeFiles = strFiles End Function machine= Request.ServerVariables("SERVER_NAME") %>
          <%=locMyPubFiles%>
<% response.write writeFiles() %>