现在问题是,他只能删除一个图片,不能批量删除啊!
好像是删除的时候不能旋转删除图片。帮我再改改好吗?
'删除文件FSO支持
Sub delFile(path)
On Error Resume Next
If path<>"" And Not IsNull(path) then
Set fso=Server.CreateObject("scripting.fileSystemobject")
If fso.FileExists(Server.Mappath(path)) then
fso.DeleteFile(Server.Mappath(path))
End If
Set fso=Nothing
End If
End Sub
if request("sort_id")<>"" or request("sort")<>"" then
'------------------------------------类别管理--------------------------------------------------
select case request.form("options")
case "del"
sql="delete * from class where sort_id="&request("sort_id")&"" '删除总类
conn.execute sql
'此处读取图片地址
set picRs = conn.execute("select pic from Product where sort_id="&request("sort_id"))
'调用删除sub
Call delFile(picRs(0))
'最好做下判断是否为空
sql="delete * from product where sort_id="&request("sort_id")&"" '删除所属类货物
conn.execute sql
response.write "<script language=javascript>alert('成功删除ID为"&request("sort_id")&"的总类及相关产品!');location='class.asp';</script>"
好像是删除的时候不能旋转删除图片。帮我再改改好吗?
'删除文件FSO支持
Sub delFile(path)
On Error Resume Next
If path<>"" And Not IsNull(path) then
Set fso=Server.CreateObject("scripting.fileSystemobject")
If fso.FileExists(Server.Mappath(path)) then
fso.DeleteFile(Server.Mappath(path))
End If
Set fso=Nothing
End If
End Sub
if request("sort_id")<>"" or request("sort")<>"" then
'------------------------------------类别管理--------------------------------------------------
select case request.form("options")
case "del"
sql="delete * from class where sort_id="&request("sort_id")&"" '删除总类
conn.execute sql
'此处读取图片地址
set picRs = conn.execute("select pic from Product where sort_id="&request("sort_id"))
'调用删除sub
Call delFile(picRs(0))
'最好做下判断是否为空
sql="delete * from product where sort_id="&request("sort_id")&"" '删除所属类货物
conn.execute sql
response.write "<script language=javascript>alert('成功删除ID为"&request("sort_id")&"的总类及相关产品!');location='class.asp';</script>"