比如在C:里面有文件夹A,文件夹A里面又有文件a1,它的路径为 C:\A\a1
能不能把这个路径完整取出来?
用FSO列举文件夹。至于路径。用server.mappath可以把相对路径转换为物理路径。给你代码自己参考下。
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>站内文件管理</title>
<link href="site_css.css" rel="stylesheet" type="text/css">
</head>
<body>
<%
FsFolder="images"
ServerFsFolder=Server.MapPath(""&FsFolder&"")
%>
<%
Dim fso, f, f1, fc, s
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder(ServerFsFolder)
Set fc = f.Files
%>
<table width="95%" border="0" cellspacing="1" cellpadding="0">
<tr bgcolor="#CCCCCC">
<td height="20"><strong> 名称</strong></td>
<td align="right"><strong>大小 </strong></td>
<td><strong> 类型</strong></td>
<td><strong> 修改日期</strong></td>
<td><strong>操作</strong></td>
</tr>
<tr bgcolor="#F6F6F6">
<%
For Each f1 in fc
Filenames= f1.name
FileType= f1.Type
FileSize= f1.Size
FileDateLastModified= f1.DateLastModified
%>
<td bgcolor="#F6F6F6" align="center"><img src="<%
=FsFolder&"/"&Filenames%>" border=0 width="100"
height="120"><br><%=server.mappath(Filenames)%></td>
<td align="right" bgcolor="#F6F6F6"><%=FileSize\1024%
> KB </td>
<td bgcolor="#F6F6F6"> <%=FileType%></td>
<td bgcolor="#F6F6F6"> <%=FileDateLastModified%></td>
<td bgcolor="#F6F6F6">删除/重命名</td>
</tr>
<%
i=i+1
Next
%>
<tr bgcolor="#EEEEEE">
<td colspan="5"> <%=i%> 个文件</td>
</tr>
</table>
</body>
</html>
http://mjdn.net/blog/posts/35.aspx
FSO读取目录和文件列表
FSO遍历就是了 看一下FSO