Recursos y Contenidos para Webmaster y Freelances del Diseño
Categoría: Códigos ASP
Muestra nombre tamaño y fecha de los archivos en una carpeta
<%@ LANGUAGE="VBSCRIPT" %>
    <% Option Explicit %>
    <HTML>
    <HEAD> <TITLE>File Viewer</TITLE> </HEAD>
    <BODY>
    <TABLE width="100%" border=1 bordercolor="#000000" align="left" cellpadding="2" cellspacing="0">
    <TR align="left" valign="top" bgcolor="#000000">
     <TD width="65%"><FONT color="#FFFFFF"><B><FONT size="2" face="Verdana, Arial, Helvetica, sans-serif">Title</FONT></B></FONT></TD>
    <TD width="10%"><FONT color="#FFFFFF"><B><FONT size="2" face="Verdana, Arial, Helvetica, sans-serif">Size</FONT></B></FONT></TD>
    <TD width="25%"><FONT color="#FFFFFF"><B><FONT size="2" face="Verdana, Arial, Helvetica, sans-serif">Date</FONT></B></FONT></TD>
    </TR>
    <%
     'File System Object
     Dim objFSO
     'File Object
     Dim objFile
     'Folder Object
     Dim objFolder
     'String To Store The Real Path
     Dim sMapPath
     'Create File System Object To Get list of files
     Set objFSO = CreateObject("Scripting.FileSystemObject")
     'Get The path For the web page and its dir.
     'change this setting To view different directories
     sMapPath = "C:\\Mydocu~1"
     'Set the object folder To the mapped path
     Set objFolder = objFSO.GetFolder(sMapPath)
     'For Each file In the folder
     For Each objFile In objFolder.Files
     %>
     <TR align="left" valign="top" bordercolor="#999999" bgcolor="#FFFFFF">
     <TD> <FONT size="2" face="Verdana, Arial, Helvetica, sans-serif" color="#000000"><A href="<% = sMapPath & "/" & objFile.Name %>">
     <%
       'write the files name
       Response.Write objFile.Name
     %>
     </A>
     </FONT>
     </TD>
    <TD>
     <FONT size="2" face="Verdana, Arial, Helvetica, sans-serif" color="#000000">
     
     <%
       'We will format the file size so it looks pretty
       if objFile.Size <1024 Then
        Response.Write objFile.Size & " Bytes"
       ElseIf objFile.Size < 1048576 Then
        Response.Write Round(objFile.Size / 1024.1) & " KB"
       Else
        Response.Write Round((objFile.Size/1024)/1024.1) & " MB"
       End if
     %>
     </FONT>
     </TD>
    <TD>
      <FONT size="2" face="Verdana, Arial, Helvetica, sans-serif" color="#000000">
       <% 'the files Date
        Response.Write objFile.DateLastModified
       %>
      </FONT>
     </TD>
     </FONT>
     </TD>
     </TR>
     <%
      Next
     %>
    </TABLE>
    </BODY>
    </HTML>



Tu Comentario!

.
Hey, Site was very interesting for me. I wish you and your site everything best! I will recommend your page to all my friends!
<a href=http://www.power-tools-on-line.info>www.power-tools-on-line.info</a>
Here price <a href=http://www.power-tools-on-line.info>LOW</a>
Presently there greater <a href=http://www.power-tools-on-line.info>discounts</a>
Icon Dijo: Lisa

.
This site is awesome. Your site is really nice! I really enjoy your site! Just cool site! No any words else to say...
Icon Dijo: Douglas

.
GearWrench 7 Piece Metric Flexible Professional Ratcheting Combination Wrench Set <a href=http://www.best-tech-store.info/kitchssa.html>KitchenAid SSA Sausage Stuffer Kit Attachment for Food Grinder</a>
Icon Dijo: Saveliy