| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 332 人关注过本帖
标题:向高手求救!关于变量保留传递的问题!
只看楼主 加入收藏
loveaoao
Rank: 1
等 级:新手上路
帖 子:22
专家分:0
注 册:2006-8-3
收藏
 问题点数:0 回复次数:0 
向高手求救!关于变量保留传递的问题!
想写个基于FSO的文件管理起!但是返回上一目录中遇到到难题!请高手指点!这里返回上一级目录老是出错!还有获取跟目录文件夹也有问题!
这是演示地址:http://yuzhuang.host001.
程序代码:
<script language=javascript>

 function    chfolder(selectitem){
    form=document.forms[0];
    form.selectItem.value=selectitem;
        form.submit();
}
</script>
<%
     Dim fs, f, f1, s, sf
    set fs=server.CreateObject("scripting.filesystemobject")
    on error resume next
    path="d:\e8088\echsop"
    hostdir=""
    selectItem=Request("selectItem")
    hostdir=Request("hostdir")
    hostdir2=hostdir+"\"+selectItem
    basedir=request("basedir")
if basedir="" then 
    set f=fs.GetFolder(path)
else
    if selectItem=".." then
        lastbasedir=basedir
        set f=fs.GetFolder(lastbasedir)
    else 
        path=basedir+"\"+selectItem
        set f=fs.GetFolder(path)
    end if
end if
    set sf=f.SubFolders
%>
<table width="800" border="0" align="center" cellpadding="0" cellspacing="0" >
<form name=form1 method=post action="fso.asp"/>

     <input type=hidden name="selectItem" value=""/>
      <input type=hidden name="basedir" value="<%=path%>" />
    <input type=hidden name="hostdir" value="<%=hostdir2%>" />
<tr > 
    <td colspan="3" background="image/floder_top.gif" height="26">?</td>
</tr>
<tr>
<td background="image/floder_left.gif" width="7" ></td>
    <td>
        <table width="100%" border="0" bgcolor="#FFFFFF" cellpadding="0" cellspacing="0"> 
            <tr>
                <td height="33" colspan="5" valign="middle" background="image/dir_back.gif">
                    <table width="100%" height="24" border="0" cellpadding="0" cellspacing="0">
                        <tr>
                            <td valign="middle" width="24"><img src="image/back_floder.gif" width="24" height="24" border="0" /></td>
                            <td width="110" ><a href="javascript:chfolder('..');" title="返回上级目录">返回上级目录</a></td>
                            <td width="44" style="border:0px;" background="image/dir_left.gif"></td>
                            <td background="image/dir_middle.gif" width="560" style="border:0px;"><%=hostdir2%></td>
                            <td width="44" style="border:0px;"  background="image/dir_right.gif"></td>
                        </tr>
                    </table>
              </td>
            </tr>
            <tr>
                <td background="image/type.gif" >??名称</td>
                <td align="right" background="image/type.gif" height="33">大小</td>
                <td background="image/type.gif" >????</td>
                <td align="left" background="image/type.gif">类型</td>
                <td align="left" background="image/type.gif">修改时间</td>
        <%
        For Each f1 in sf
    %>
    </tr>
    <tr>
        <td>
            ??<a href="javascript:chfolder('<%=f1.name%>');" title="点击选择文件夹<%=f1.name%>"><img src="image/folder.gif" width="16" height="16" border="0"/><%=f1.name%></a>
        </td>
        <td align="center"></td>
        <td>????</td>
        <td align="left"><%=f1.Type%></td>
        <td align="left"><%=f1.DateLastModified%></td>
  </tr>
    <%
    'bianli(nowpath)'递归
    next 
    %>
    <%
    set objFiles=f.Files
    for each objFile in objFiles
    %>
    <tr>
        <td>??<%=objFile.name%></td>
        <td align="right">
            <% 
            if (objFile.Size\1024)<>"0" then 
                Response.Write(objFile.Size\1024&"Kb")
                else
                Response.Write(objFile.Size&"K")
            end if
            %>
        <td>????</td>
        <td align="left"><%=objFile.Type%></td>
        <td align="left"><%=objFile.DateLastModified%></td>
    </tr>
    <%
    next
    set f1=nothing
    set f=nothing
    set fs=nothing
    'end function
%>
</table>
</td>
<td background="image/floder_right.gif" width="7"></td>
</tr>
<tr>
    <td colspan="3" background="image/floder_bottom.gif" height="77">?</td>
</tr>
</table>


[[it] 本帖最后由 loveaoao 于 2008-4-23 19:47 编辑 [/it]]
搜索更多相关主题的帖子: 变量 
2008-04-23 19:43
快速回复:向高手求救!关于变量保留传递的问题!
数据加载中...
 
   



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

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