fso 删除图片问题,我已经写好的代码,帮忙看下
这是显示图片页面<!--#include file="dele.asp"-->
<style type="text/css">
<!--
.STYLE1 {
color: #CC0000;
font-size: 16px;
}
-->
</style>
<table width="100%" border="1" cellpadding="0" style="border-collapse:collapse" cellspacing="0" bordercolor="#D4D0C8">
<tr height="18" align="center" bgcolor="" style="">
<td colspan="5">我的相册</td>
</tr>
<tr bgcolor="#f9f9f9" align="center"><td>
<%
Page=Request.QueryString("Page")
if Page="" then
Page=1
else Page=cint(Page)
end if
PatentFolder = "image/欧洲风景照/"
FoldPage = 16
Set Fso = CreateObject("Scripting.FileSystemObject")
if Fso.FolderExists(Server.Mappath(PatentFolder)) then
Set FolderCount = Fso.GetFolder(Server.Mappath(PatentFolder)).files
For Each F1 in FolderCount
if (Page-1)*FoldPage<=i and i<(Page-1)*FoldPage+FoldPage then
%>
<div style="float:left; width:200px; height:210px">
<table width="98%" align="center" style="border:#CCCCCC 1px solid">
<tr>
<td>
<form naem="form1" method="post" action="">
<img src="<%=PatentFolder&F1.Name%>" style="width:150px; height:119px;" /><br>
<%=F1.name%><br>
<%=F1.DateLastAccessed%><br>
<label>
<input type="checkbox" name="checkbox" value="checkbox1" />
<input type="submit" name="Submit" value="删除" />
<input type="hidden" name="PatentFolder" value="<%=form1%>" />
</label></form></td>
</tr>
</table>
</div>
<%
end if
i=i+1
next
ThePageCount = Sgn(FolderCount.Count/FoldPage)+fix(FolderCount.Count/FoldPage)-1
TheFileCount = FolderCount.Count
Set FolderCount = Nothing
Set Fso = Nothing
%>
</td>
</tr>
<tr align="center" bgcolor="#e7e7e7" height="20">
<td colspan="15">
<%
Response.Write "共<b>"&TheFileCount&"</b>张 共<b>"&ThepageCount&"</b>页 当前第<b>"&page&"</b>页 "
If page=1 then
response.Write "<a>首页</a>"
else
Response.Write "<a href=?page=1>首页</a> "
end if
If page>1 Then
Response.Write "<a href=?page="&page-1&">上一页</a> "
Else
Response.Write "上一页 "
End If
If page<ThepageCount Then
Response.Write "<a href=?page="&page+1&">下一页</a> "
Else
Response.Write "下一页 "
End If
If page=ThepageCount then
Response.Write "<a>尾页</a>"
Else
Response.Write "<a href=?page="&ThepageCount&">尾页</a> "
End If
Else
Response.write "无指定目录"
End If
%>
</td>
</tr>
</table>
错误在这里,我是想删除图片,但是删不了...
帮忙看下
万谢!!!!!
<%
dim fso
form1=request.Form("form1")
checkbox=request.Form("checkbox1")
submit=request.Form("submit")
set fso=Server.CreateObject("Scripting.FileSystemObject")
If submit="删除" And checkbox="checkbox1" then
PatentFolder=request.Form("PatentFolder & F1.name")
arrFil=split(checkbox,",")
For each s in arrFil
s=Trim(s)
response.Write "删除图片:"& server.MapPath(PatentFolder & "/" & s) & "<br>"
fso.DeleteFile(server.MapPath(PatentFolder & "/" & s))
Next
End If
%>