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