日期:2014-05-17  浏览次数:21089 次

图片路径问题
<%
If   request( "action ")= "del "   then
call   del()
end   if

sub   del()
if   Request( "id ")= " "   then
response.write " <script   language= 'javascript '> alert( '请选择你要删除的商品! ') </script> "
exit   sub
end   if
For   I=1   To   Request.Form( "ID ").Count
ID   =   Replace(Request.Form( "ID ")(I), " ' ", " ")
ID   =   CLng(ID)
sql= "select   *   from   product   where   id= "   &   id
set   rs=server.CreateObject( "Adodb.recordset ")
rs.open   sql,conn,1,1
imgpath=trim(rs( "pic "))
set   fso   =   Server.Createobject( "Scripting.FileSystemObject ")  
path   =   server.MapPath(imgpath)
fso.DeleteFile(path)
set   fso   =   nothing  
conn.execute( "delete   *   from   product   where   id= "   &   id)
response.redirect "11.asp "
next
end   sub
%>


imgpath=trim(rs( "pic "))
这句的pic是本目录的路径,我想改成上一层目录的路径,怎么改?

------解决方案--------------------
imgpath = "../ " & trim(rs( "pic "))