显示本机硬盘文件asp源码(本地硬盘文件浏览器)
<%@ LANGUAGE="VBSCRIPT" %><br /><% Option Explicit %><br /><HTML><br /><HEAD> <TITLE>文件浏览器</TITLE> </HEAD><br /><BODY><br /><TABLE width="100%" border=1 bordercolor="#000000" align="left" cellpadding="2" cellspacing="0"><br /><TR align="left" valign="top" bgcolor="#800000" > <br /><TD width="60%"><FONT color="#ffffff"><B><FONT size="2" face="宋体">文件名</FONT></B></FONT></TD><br /><TD width="15%"><FONT color="#ffffff"><B><FONT size="2" face="宋体">大小</FONT></B></FONT></TD><br /><TD width="25%"><FONT color="#ffffff"><B><FONT size="2" face="宋体">修改日期</FONT></B></FONT></TD><br /></TR><br /><%<br />Dim objFSO<br />Dim objFile<br />Dim objFolder<br />Dim sMapPath<br />Set objFSO = CreateObject("Scripting.FileSystemObject")<br />sMapPath ="c:\windows"<br />Set objFolder = objFSO.GetFolder(sMapPath)<br />For Each objFile In objFolder.Files<br />%> <br /><TR align="left" valign="top" bordercolor="#999999" bgcolor='f7efde'> <br /><TD> <FONT size="2" face="宋体" color="#000000"><A href="<% = sMapPath & "/" & objFile.Name %>"> <br /><%<br />Response.Write objFile.Name<br />%><br /></A><br /></FONT><br /></TD><br /><TD><br /><FONT size="2" face="宋体" color="#000000"><br /><%<br />If objFile.Size <1024 Then<br />Response.Write objFile.Size & " Bytes"<br />ElseIf objFile.Size < 1048576 Then<br />Response.Write Round(objFile.Size / 1024.1) & " KB"<br />Else<br />Response.Write Round((objFile.Size/1024)/1024.1) & " MB"<br />End If<br />%><br /></FONT><br /></TD><br /><TD><br /><FONT size="2" face="宋体" color="#000000"><br /><% <br />Response.Write objFile.DateLastModified<br />%><br /></FONT><br /></TD><br /></FONT><br /></TD><br /></TR><br /><%<br />Next<br />%> <br /></TABLE><br /></BODY><br /></HTML>
页:
[1]