www.gusucode.com > WapEditFile手机WAP文件管理器源码 > wap_filepost.asp
<!--#include file="wap_common.asp"--> <!--#include file="wap_check.asp"--> <!--#include file="wap_verify.asp"--> <%Response.ContentType="text/vnd.wap.wml; charset=utf-8"%> <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml"> <wml> <head><meta http-equiv='Cache-Control' content='no-cache'/> </head> <card id='wuyumin' title='遍历文件(操作)'> <p> <!--#include file="wap_top.asp"--> <!--#include file="wap_top_end.asp"--> </p> <p> <% Function f_size(fsize) if fsize<1024 then f_size=fsize&"Bytes" elseif fsize<1048576 then f_size=round(fsize/1024,2)&"KB" else f_size=round(fsize/1048576,3)&"MB" end if End Function page=trim(request.querystring("page")) FolderPath=trim(request("FolderPath")) pagesize=10 if page="" or not isnumeric(page) then page=1 else page=int(page) end if Set fso=Server.CreateObject("Scripting.FileSystemObject") response.Write "相对路径:"&FolderPath&"<br/>" response.write "<a href='wap_newfile.asp?NewFile="&FolderPath&"'>当前相对路径下新建文件</a><br/>" response.write "<a href='wap_upload_set.asp?FolderPath="&FolderPath&"'>当前相对路径下 上传文件</a>[需手机支持]<br/>" response.write "【文件列表】<br/>" YesFolder=server.MapPath(FolderPath)'相对路径 'on error resume next Set MyFolder=fso.GetFolder(YesFolder) '读取某目录中的文件列表 Set allfiles=MyFolder.Files filenum=allfiles.count pagenum=int(filenum/pagesize) if filenum mod pagesize>0 then pagenum=pagenum+1 end if if page>pagenum then page=1 end if i=0 For Each Upname In allfiles i=i+1 if i>(page-1)*pagesize and i<=page*pagesize then dim filepath,filepath2 if right(FolderPath,1)="/" then filepath=FolderPath else filepath=FolderPath&"/" end if filepath2=filepath&upname.name response.write " "&upname.name&" ("&f_size(upname.size)&")<br/>" response.write "<a href='wap_edit1.asp?EditFile="&filepath2&"'>编辑</a>" response.write "|" response.write "<a href='wap_copyfile.asp?SourceFile="&filepath2&"'>复制</a>" response.write "|" response.write "<a href='wap_renamefile.asp?SourceFile="&filepath2&"'>重命名</a>" response.write "|" response.write "<a href='wap_delfile.asp?DelFile="&filepath2&"'>删除</a>" response.write "|" response.write "<a href='"&filepath2&"'>链接</a>" response.write "<br/>" elseif i>page*pagesize then exit for end if next if filenum<>0 then if page>1 then response.write "<a href='wap_filepost.asp?page=1&FolderPath="&request("FolderPath")&"'>首页</a> <a href='wap_filepost.asp?page="&page-1&"&FolderPath="&request("FolderPath")&"'>上页</a> " else response.write "首页 上页 " end if if page<i/pagesize then response.write "<a href='wap_filepost.asp?page="&page+1&"&FolderPath="&request("FolderPath")&"'>下页</a> <a href='wap_filepost.asp?page="&pagenum&"&FolderPath="&request("FolderPath")&"'>尾页</a>" else response.write "下页 尾页" end if response.write "<br/>(当前第"&page&"页,共"&pagenum&"页)" response.write "<br/>(共"&filenum&"个文件)" if i/pagesize>1 then response.write "<input name='a' emptyok='false' value='2' format='*N'/><anchor>转到指定页GO<go href='wap_filepost.asp?page=$(a:N)&FolderPath="&request("FolderPath")&"'></go></anchor><br/>"&chr(13) end if else response.write "没有文件<br/>" end if set MyFolder=nothing set allfiles=nothing %> </p> <p> <!--#include file="wap_footer_head.asp"--> <!--#include file="wap_footer.asp"--> </p> </card> </wml>