以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  weui用list做的下载列表,子目录问题  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=186718)

--  作者:wjl-se
--  发布时间:2023/5/23 15:26:00
--  weui用list做的下载列表,子目录问题
Dim e As RequestEventArgs = args(0)
Dim wb As New WeUI
With wb.AddListGroup("", "lsg1", "文件下载列表") 
    Dim path As String = ProjectPath & "upload"
    If FileSys.DirectoryExists(path) = False Then \'如果目录不存在新建一个
        FileSys.CreateDirectory(path)
    End If
    If FileSys.GetFiles(path).Count > 0 Then \'如果有文件给出列表
        Dim i As Integer
        For Each File As String In FileSys.GetFiles(path)
            i = i + 1
            .Add(i, FileSys.GetName(file), "下载", File.Replace(ProjectPath, ""), "./images/download.png").Attribute = "download=\'" & FileSys.GetName(file) & "\'"
        Next
    End If
    For Each dir As String In FileSys.GetDirectories(path) \'列出子目录
        Dim id As String = dir.Replace(path, "").Replace("\\", "")
        .Add(id, id, "打开", "folder.htm", "./images /folder.png") \'【下一步点击文件夹列出其中的文件就不会了,如何传递点击的哪个文件夹?
    Next
End With
With wb.AddPageFooter("", "pf1", "")
    .AddLink("返回首页", "default.htm")
End With
e.WriteString(wb.Build) \'生成网页
图片点击可在新窗口打开查看此主题相关图片如下:360截图20230523152434868.jpg
图片点击可在新窗口打开查看

--  作者:有点蓝
--  发布时间:2023/5/23 15:33:00
--  
.Add(id, id, "打开", "folder.htm?id=" & id, "./images /folder.png")

后台通过get参数获取id值即可

--  作者:wjl-se
--  发布时间:2023/5/23 15:53:00
--  
好的,懂了,谢谢老师