急急急、跪求哥哥姐姐帮忙,我想用asp完成删除获得目录下的图片,并且将剩余的图片重新按顺序命名怎么写 10
这是已知代码,下边注释的符号是要填的删除和重命名的句子,跪求补充,谢谢<%dimidnumSavePath=Server.MapPath("/web/upimages/"...
这是已知代码,下边注释的符号是要填的删除和重命名的句子,跪求补充,谢谢
<%
dim idnum
SavePath = Server.MapPath("/web/upimages/") '存放上传文件的目录
idnum=Cint(Request.QueryString("ID"))
if Cint(Request.QueryString("dflag"))>0 then
bb=split(request("checkbox"))
set rs=server.CreateObject("adodb.recordset")
sql="SELECT * FROM subject_detail where subject_detail.ID="&idnum
rs.open sql,connGraph,1,3
inum=Cint(rs("img_num"))
Dim farr
farr = Array()
Redim farr(inum+1)
for i=1 to inum
farr(i)=0
next
wid=0
for each b in bb
if wid=0 then wid=cint(b)
farr(cint(b))=1
next
for i=wid to inum
if farr(i)=1 then
'del i
' ifilename="../upimages/I"&right(cstr((cint(idnum)+10000)*100+i),6)&".jpg"
else
wid=wid+1
end if
next
rs("img_num")=wid-1
rs.update
rs.close
connGraph.close
set rs=nothing
set connGraph=nothing
end if
set rs=server.CreateObject("adodb.recordset")
sql="SELECT * FROM subject_detail where subject_detail.ID="&idnum
rs.open sql,connGraph,1,1
inum=Cint(rs("img_num"))
%>
</p>
<form id="form1" name="form1" method="post" action="editimg.asp?ID=<%=idnum%>&dflag=1">
<table width="786" height="352" border="0" cellpadding="0" cellspacing="0">
<%
dim i
i=1
while(i<inum+1)
ifilename="../upimages/I"&right(cstr((cint(idnum)+10000)*100+i),6)&".jpg"
%>
<tr>
<td width="373">
<p><img src="<%=ifilename%>" width="368" height="275" /></p>
<p><input type="checkbox" name="checkbox" value="<%=i%>">删除</p>
</td>
<%
i=i+1
if i mod 2 =0 then
ifilename="../upimages/I"&right(cstr((cint(idnum)+10000)*100+i),6)&".jpg"
%>
<td width="373">
<p><img src="<%=ifilename%>" width="368" height="275" /></p>
<p><input type="checkbox" name="checkbox" value="<%=i%>">删除</p>
</td>
</tr>
<%
i=i+1
else%>
<td width="373">
</td>
</tr>
<%
end if
wend
%> 展开
<%
dim idnum
SavePath = Server.MapPath("/web/upimages/") '存放上传文件的目录
idnum=Cint(Request.QueryString("ID"))
if Cint(Request.QueryString("dflag"))>0 then
bb=split(request("checkbox"))
set rs=server.CreateObject("adodb.recordset")
sql="SELECT * FROM subject_detail where subject_detail.ID="&idnum
rs.open sql,connGraph,1,3
inum=Cint(rs("img_num"))
Dim farr
farr = Array()
Redim farr(inum+1)
for i=1 to inum
farr(i)=0
next
wid=0
for each b in bb
if wid=0 then wid=cint(b)
farr(cint(b))=1
next
for i=wid to inum
if farr(i)=1 then
'del i
' ifilename="../upimages/I"&right(cstr((cint(idnum)+10000)*100+i),6)&".jpg"
else
wid=wid+1
end if
next
rs("img_num")=wid-1
rs.update
rs.close
connGraph.close
set rs=nothing
set connGraph=nothing
end if
set rs=server.CreateObject("adodb.recordset")
sql="SELECT * FROM subject_detail where subject_detail.ID="&idnum
rs.open sql,connGraph,1,1
inum=Cint(rs("img_num"))
%>
</p>
<form id="form1" name="form1" method="post" action="editimg.asp?ID=<%=idnum%>&dflag=1">
<table width="786" height="352" border="0" cellpadding="0" cellspacing="0">
<%
dim i
i=1
while(i<inum+1)
ifilename="../upimages/I"&right(cstr((cint(idnum)+10000)*100+i),6)&".jpg"
%>
<tr>
<td width="373">
<p><img src="<%=ifilename%>" width="368" height="275" /></p>
<p><input type="checkbox" name="checkbox" value="<%=i%>">删除</p>
</td>
<%
i=i+1
if i mod 2 =0 then
ifilename="../upimages/I"&right(cstr((cint(idnum)+10000)*100+i),6)&".jpg"
%>
<td width="373">
<p><img src="<%=ifilename%>" width="368" height="275" /></p>
<p><input type="checkbox" name="checkbox" value="<%=i%>">删除</p>
</td>
</tr>
<%
i=i+1
else%>
<td width="373">
</td>
</tr>
<%
end if
wend
%> 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询