| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 456 人关注过本帖
标题:fso 删除图片问题,我已经写好的代码,帮忙看下
只看楼主 加入收藏
yolonice
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2009-6-25
结帖率:100%
收藏
已结贴  问题点数:20 回复次数:5 
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
%>
搜索更多相关主题的帖子: 删除 代码 fso 
2009-06-25 22:26
multiple1902
Rank: 8Rank: 8
等 级:贵宾
威 望:42
帖 子:4881
专家分:671
注 册:2007-2-9
收藏
得分:0 
确认文件路径没有问题的话,检查文件权限。

把提交给fso的参数打出来试试。
2009-06-25 22:34
yolonice
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2009-6-25
收藏
得分:0 
回复 2楼 multiple1902
权限路径都没出问题...
<%
dim fso
form1=request.Form("form1")
checkbox=request.Form("checkbox1")
submit=request.Form("submit")

set fso=Server.CreateObject("Scripting.FileSystemObject")

If submit="删除" And checkbox<>"" 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
%>
2009-06-25 22:48
快速回复:fso 删除图片问题,我已经写好的代码,帮忙看下
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.015807 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved