谁帮我看看这个程序!!谢谢了!
<%
sub FOLDER_SHOW(ThisFName)
pathstr=Request.ServerVariables("PATH_TRANSLATED")
pathstr=replace(pathstr,ThisFName,"")
set fso=Server.CreateObject("Scripting.FileSystemObject").GetFolder(pathstr)'创建文件对象
Set SubFolders=fso.SubFolders'获得当前目录的所有子目录
Set FoldFiles=fso.Files'获得当前目录下的文件
Response.Write("<table width='697' border='0' align='center' cellpadding='1' cellspacing='1' bgcolor='#000000' class='my10pt'>")
Response.Write("<tr align='center' bgcolor='#99CCFF'>")
Response.Write("<td width='547'>当前目录下的文件名</td>")
Response.Write("<td width='147'>创建日期</td></tr>")
For Each Files In FoldFiles
if ThisFName<>Files.Name then
Response.Write("<tr align='center' bgcolor='#FFFFCC'>")
Response.Write("<td nowrap> <a href='")
Response.Write(Files.Name)
Response.Write("'target='_blank'>")
Response.Write(Files.Name)
Response.Write( "</a></td><td nowrap>")
Response.Write(Files.DateCreated)
Response.Write("</td></tr>")
else
end if
Response.Write("</table>")
next
end sub
%>
参考答案:把"else"去掉就可以了,下面是修改好的程序!
<%
sub FOLDER_SHOW(ThisFName)
pathstr=Request.ServerVariables("PATH_TRANSLATED")
pathstr=replace(pathstr,ThisFName,"")
set fso=Server.CreateObject("Scripting.FileSystemObject").GetFolder(pathstr)'创建文件对象
Set SubFolders=fso.SubFolders'获得当前目录的所有子目录
Set FoldFiles=fso.Files'获得当前目录下的文件
Response.Write("<table width='697' border='0' align='center' cellpadding='1' cellspacing='1' bgcolor='#000000' class='my10pt'>")
Response.Write("<tr align='center' bgcolor='#99CCFF'>")
Response.Write("<td width='547'>当前目录下的文件名</td>")
Response.Write("<td width='147'>创建日期</td></tr>")
For Each Files In FoldFiles
if ThisFName<>Files.Name then
Response.Write("<tr align='center' bgcolor='#FFFFCC'>")
Response.Write("<td nowrap> <a href='")
Response.Write(Files.Name)
Response.Write("'target='_blank'>")
Response.Write(Files.Name)
Response.Write( "</a></td><td nowrap>")
Response.Write(Files.DateCreated)
Response.Write("</td></tr>")
end if
next
Response.Write("</table>")
end sub
FOLDER_SHOW "文件名"
%>
我测试过了,能用的!