<% Dim filename,id,msg filename=Trim(Request("filename")) if filename="" then filename="X" end if id =Trim(Request("id")) Set Fs = Server.CreateObject("Scripting.FileSystemObject") Path = filename conn.execute("delete * from product Where pid="&id) If Fs.FileExists(server.mappath(Path)) Then Set Os = Fs.GetFile(server.mappath(Path)) Os.Delete msg = "<font color='red'><b>"& replace(Path,"uploadfile/","") &"</b></font> 已被删除!" Else msg = "<font color='red'><b>"& Path &"</b></font> 此图片不存在!数据已被删除!" End If closedb() %>
|