<%@language=VBScript.Encode codepage=936 %>
<!--#include file="conn.asp"-->
<!--#include file="application.asp"-->
<!--#include file="admin.asp"-->
<!--#include file="Inc/Function.asp"-->
<%
If trim(request("action"))="Del" then
   ID=trim(request("ID"))
   If ID="" then
      response.Write("<script lanaguge='javascript'>alert('参数有错误！！');history.back();</script>")
      response.End()
   end if
   set rs=server.CreateObject("adodb.recordset")
   rs.open"select * from ProdList where ID in ("&ID&")",conn,1,3
   do while not rs.eof

		  FileName=rs("BigPic")
          If FileName<>"" And Not IsNull(path) then 
				Set fso=Server.CreateObject("scripting.fileSystemobject") 
				If fso.FileExists(Server.Mappath("/"&FileName)) then 
					fso.DeleteFile(Server.Mappath("/"&FileName)) 
				End If 
				Set fso=Nothing 
          End If
		  FileName=rs("SmallPic")
          If FileName<>"" And Not IsNull(path) then 
				Set fso=Server.CreateObject("scripting.fileSystemobject") 
				If fso.FileExists(Server.Mappath("/"&FileName)) then 
					fso.DeleteFile(Server.Mappath("/"&FileName)) 
				End If 
				Set fso=Nothing 
          End If 

	  rs.delete
      rs.update
	rs.movenext
	loop
    rs.close:set rs=nothing
    response.Write("<script lanaguge='javascript'>alert('作品删除成功！');location.href='Product_Manage.asp';</script>")
    response.End()
end if
%>