在文件夹的容易,不过要支持FSO才行的哦,不过同时删除数据库的记录就有点难了,我还没有想好,现在给你一个删除文件夹中的文件的代码吧
[QUOTE]<table width="99%" border="0" align="center" cellpadding="6" cellspacing="1" class="TBG3">
<tr class="TBG1">
<td><Font class="Fontone">附件管理</font> </td>
</tr>
<tr class="TBG2">
<td><%IF Request.QueryString("type")="DeleFile" Then
IF Request.QueryString("filename")=Empty Then
Response.Write("<a href=""Del.asp"">没有选择要删除的文件,请点击返回</a>")
Else
IF DeleteFiles(Server.MapPath("你的文件夹/"&Request.QueryString("filename")))=1 Then
Response.Write("<a href=""Del.asp"">文件删除成功,请点击返回</a>")
Else
Response.Write("<a href=""Del.asp"">文件删除失败,请点击返回</a>")
End IF
End IF
Else
Dim AttachmentFolder
Set FSO=Server.CreateObject("Scripting.FileSystemObject")
IF Err<>0 Then
Err.Clear
Response.Write("服务器关闭FSO,无法查看附件")
Else
If Request.QueryString("FolderName")=Empty Then
Set AttachmentFolder=FSO.GetFolder(Server.MapPath("heyuying"))
Dim AttachmentFolderList
Set AttachmentFolderList=AttachmentFolder.SubFolders
Dim AttachmentFolderName,AttachmentFolderEvery
For Each AttachmentFolderEvery IN AttachmentFolderList
AttachmentFolderName=AttachmentFolderEvery.Name
Response.Write("<a href=""Del.asp?foldername="&AttachmentFolderName&""">浏览文件夹"&AttachmentFolderName&"中的附件</a><br><img name=""HideImage"" src="""" width=""2"" height=""5"" alt="""" style=""background-color: #FFFFFF""><br>")
Next
Set AttachmentFolderList=Nothing
Else
Set AttachmentFolder=FSO.GetFolder(Server.MapPath("你的文件夹/"&Request.QueryString("FolderName")))
Dim AttachmentFileList
Set AttachmentFileList=AttachmentFolder.Files
Dim AttachmentFileName,AttachmentFileEvery
For Each AttachmentFileEvery IN AttachmentFileList
AttachmentFileName=AttachmentFileEvery.Name
Response.Write("浏览附件 <a href=""你的文件夹/"&Request.QueryString("FolderName")&"/"&AttachmentFileName&""" target=""_blank"">"&AttachmentFileName&"</a> | <a href=""Del.asp?type=DeleFile&filename="&Request.QueryString("FolderName")&"/"&AttachmentFileName&"""><b>删除文件</b></a><br><img name=""HideImage"" src="""" width=""2"" height=""5"" alt="""" style=""background-color: #FFFFFF""><br>")
Next
Set AttachmentFileList=Nothing
End If
Set AttachmentFolder=Nothing
End If
Set FSO=Nothing
End IF%></td>
</tr>
</table>[/QUOTE]