您现在的位置: 军旅同心-旅游自驾-军旅文学 >> 读书赏析 >> 学习园地 >> 电脑网络 >> 技术文章 >> 正文
ASP文件操作--列出目录及文件
作者:采集员 文章来源:来源于网络 点击数: 更新时间:2005-9-10 12:50:07
;br>"&thing)
    '===============Get file information
    Set afile=MyFileObject.GetFile(thing)
    
    '==========filename correct code
    filenamecode=afile.name
    filedetail=folderspc+filenamecode
    filedetail=replace(filedetail,"","*s_p_l_i_t*")
    filesize=afile.size
    lastmodify=afile.DateLastModified

Response.write("<table width='780' border='0' cellspacing='1' cellpadding='1'>")
Response.write("<tr>")
Response.write("<td width='300' bgcolor='#f4f4ff'><font face='Wingdings' font size='3pt'><</font><a href="&chr(34)&"javascript:fileinfo('"&filedetail&"','"&filesize&"','"&lastmodify&"')"&chr(34)&">"&filenamecode&"</a></td>")
Response.write("<td width='180' bgcolor='#f4f4ff'>"&filesize&"</td>")
Response.write("<td width='300' bgcolor='#f4f4ff'>"&lastmodify&"</td>")
Response.write("</tr>")
Response.write("</table>")
Next
End sub
%>
</body>
</html>


----文件fileinfo.asp-----
<%
filename=Request.QueryString("filename")
filename=replace(filename,"*s_p_l_i_t*","")
filesize=Request.QueryString("filesize")
lastmodify=Request.QueryString("lastmodify")
%>
<html>
<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>
<body>
<%
'Response.write filename&"<br>"&filesize&"<br>"&lastmodify
%>
<table width="400" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td bgcolor="#00CC00" colspan="2">Current File Info:</td>
  </tr>
  <tr valign="top">
    <td width="110">File Location:</td>
    <td width="290"><font color="#990000"><font face='Wingdings' font size='3pt'><</font><b> <%=filename%></b></font></td>
  </tr>
  <tr>
    <td colspan="2">
      <hr size="1">
    </td>
  </tr>
  <tr valign="top">
    <td height="11">File Size: </td>
    <td height="11"><%=filesize%> bytes</td>
  </tr>
  <tr>
    <td colspan="2">
      <hr size="1">
    </td>
  </tr>
  <tr valign="top">
    <td>LastModify: </td>
    <td><%=lastmodify%></td>
  </tr>
  <tr>
    <td colspan="2">
      <hr size="1">
    </td>
  </tr>
  <tr>
    <td height="18" colspan="2">
      <p>Please Use appropriate Application to Open this File.</p>
    </td>
  </tr>
  <tr>
    <td height="13" align="right" colspan="2"><a href="javascript:this.window.close()">Close
      Window</a></td>
  </tr>
</table>
</body>
</html>




上一页  [1] [2] 


更多
免责声明:作品版权归所属媒体与作者所有!!本站刊载此文不代表同意其说法或描述,仅为提供更多信息。如果您认为我们侵犯了您的版权,请告知!本站立即删除。有异议请联系我们。
文章录入:烟灰缸    责任编辑:烟灰缸 
网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
| 设为首页 | 加入收藏 | 联系站长 | 友情链接 | 网站地图 | 版权申明 | 网站公告 | 管理登录 |