首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > ASP >

图片路径有关问题

2012-03-11 
图片路径问题%Ifrequest( action ) del thencalldel()endifsubdel()ifRequest( id ) thenresp

图片路径问题
<%
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 "))

热点排行