以下是某论坛的类似效果的一段代码,看能不借鉴一下,我整不懂,只因我太菜!
'删除所选
Sub DelOptFile
Dim FileName,FSO,Folder,Files,Upname,Temp,i,S
On Error Resume Next
Set FSO = Server.CreateObject("Scripting.FileSystemObject")
If Err Then
Goback"","操作失败,空间不支持FOS文件读写!。"
err.Clear
Exit Sub
End If
FileName=Request("ID")
If FileName="" Then GoBack"","请先选择项目。":Exit Sub
Temp=Split(FileName,",")
For i=0 To uBound(Temp)
BBS94KK.execute("Delete * From [KK_UpFile] Where FileName='"&Trim(Temp(i))&"'")
Next
Set Folder=fso.Getfolder(server.MapPath(BBS94KK.Info(36)))
Set files=folder.files
For Each Upname In files
If instr(FileName,Upname.name)>0 then
FSO.DeleteFile(Server.MapPath(TopicFile&Upname.name))
End if
Next
Set Folder=nothing
Set Files=nothing
Set Fso=nothing
S="成功删除了所选的上传文件。"
BBS94KK.NetLog "操作后台_"&S
Suc"",S,"?"
End Sub
[此贴子已经被作者于2007-10-4 9:02:56编辑过]