• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
  • 用asp遍歷目錄下文件的例子

    發表于:2007-05-25來源:作者:點擊數: 標簽:
    % 'By aloxy ,E-mail:szyjj@hotmail.com,OI CQ :331622229 sub ListFolderContents(path) dim fs, folder, file, item, url set fs = CreateObject("Scripting.FileSystemObject") set folder = fs.GetFolder(path) 'Display the target folder and info. Re

    <%
    'By aloxy ,E-mail:szyjj@hotmail.com,OICQ:331622229
    sub ListFolderContents(path)


         dim fs, folder, file, item, url


         set fs = CreateObject("Scripting.FileSystemObject")
         set folder = fs.GetFolder(path)


        'Display the target folder and info.


         Response.Write("<li><b>" & folder.Name & "</b> - " _
           & folder.Files.Count & " files, ")
         if folder.SubFolders.Count > 0 then
           Response.Write(folder.SubFolders.Count & " directories, ")
         end if
         Response.Write(Round(folder.Size / 1024) & " KB total." _
           & vbCrLf)


         Response.Write("<ul>" & vbCrLf)


         'Display a list of sub folders.


         for each item in folder.SubFolders
           ListFolderContents(item.Path)
         next


         'Display a list of files.


         for each item in folder.Files
           url = MapURL(item.path)
           Response.Write("<li><a href=""" & url & """>" & item.Name & "</a> - " _
             & item.Size & " bytes, " _
             & "last modified on " & item.DateLastModified & "." _
             & "</li>" & vbCrLf)
         next


         Response.Write("</ul>" & vbCrLf)


         Response.Write("</li>" & vbCrLf)


       end sub


       function MapURL(path)


         dim rootPath, url


         'Convert a physical file path to a URL for hypertext links.


         rootPath = Server.MapPath("/")
         url = Right(path, Len(path) - Len(rootPath))
         MapURL = Replace(url, "\", "/")


       end function %>

    原文轉自:http://www.kjueaiud.com

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>