- 爱易网页
-
ASP教程
- ASP文件操作--列出目录及文件
日期:2011-04-22 浏览次数:20968 次
把以下文件建在同一目录,IIS中确定文件操作组件可用,即可用ASP列出文件和目录了,呵呵欢迎光临我的主页 http://skypavilion.yeah.net
----文件folder.inc-----
<%
folderini="c:\"
%>
----文件index.asp-----
<!--#Include file="folder.inc"-->
<html>
<head>
<title>FileSearch</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<frameset rows="80,*" frameborder="1" border="1" framespacing="1" cols="*">
<frame name="topFrame" scrolling="NO" src="up.asp" >
<frame name="mainFrame" src="getinfo.asp?foldinfo=<%=folderini%>">
</frameset>
<noframes><body bgcolor="#FFFFFF">
</body></noframes>
</html>
----文件up.asp-----
<!--#Include file="folder.inc"-->
<html><title>Up</title>
<head>
<style type="text/css">
<!--
.ttl1_txt { font-family: "Verdana", "Arial", "Helvetica", "sans-serif"; font-size: 9pt}
.cnt_txt { font-family: "Verdana", "Arial", "Helvetica", "sans-serif"; font-size: 9pt}
A:link{color:#0000ff;text-decoration: none}
A:visited {color:#0000ff;text-decoration: none}
A:active {color:#33ccff;text-decoration: underline}
A:hover {color:#33ccff;text-decoration: underline}
body{font-family: "Verdana", "Arial", "Helvetica", "sans-serif"; font-size: 9pt}
Tr{font-family: "Verdana", "Arial", "Helvetica", "sans-serif"; font-size: 9pt}
TD{font-family: "Verdana", "Arial", "Helvetica", "sans-serif"; font-size: 9pt
-->
</style>
</head>
<table width="780" border="0" cellspacing="1" cellpadding="1">
<tr align="center">
<td align="center"><a href="getinfo.asp?foldinfo=<%=folderini%>" target="mainFrame">List All Folder/File Info</a>
</td>
</tr>
</table>
</html>
----文件getinfo.asp-----
<!--#Include file="folder.inc"-->
<%foldinfo=trim(Request.Querystring("foldinfo"))%>
<html>
<head>
<title>GetInfo</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
.ttl1_txt { font-family: "Verdana", "Arial", "Helvetica", "sans-serif"; font-size: 9pt}
.cnt_txt { font-family: "Verdana", "Arial", "Helvetica", "sans-serif"; font-size: 9pt}
A:link{color:#0000ff;text-decoration: none}
A:visited {color:#0000ff;text-decoration: none}
A:active {color:#33ccff;text-decoration: underline}
A:hover {color:#33ccff;text-decoration: underline}
body{font-family: "Verdana", "Arial", "Helvetica", "sans-serif"; font-size: 9pt}
Tr{font-family: "Verdana", "Arial", "Helvetica", "sans-serif"; font-size: 9pt}
TD{font-family: "Verdana", "Arial", "Helvetica", "sans-serif"; font-size: 9pt
-->
</style>
<Script Language="JavaScript">
function fileinfo(filenamecode,filesize,lastmodify){
//document.write(filenamecode);
window.open("fileinfo.asp?filename="+filenamecode+"&filesize="+filesize+"&lastmodify="+lastmodify,"","height=200,width=450,resizable=yes,scrollbars=yes,status=yes,toolbar=no,menubar=no,location=no");
}
</Script>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<table width="780" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="cnt_txt"> <font color="#000000">Current Folder:--</font><font color="#FF7120"><%=foldinfo%></font></td>
</tr>
<tr>
<td>
免责声明: 本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。