老师,我用List制做了一个文件下载列表,xls文件等都可以自动下载,但是pdf等浏览器可以打开的确不能下载,也不能打开,请老师指点,如何才能实现这个功能,我防照着您ExWeUI的例子搭建的网站
此主题相关图片如下:微信截图_20221128150152.png
此主题相关图片如下:微信截图_20221125170558.png
Dim e As RequestEventArgs = args(0)
Select Case e.Path
Case "myfile.htm" '登录页面
Dim wb As New weui
With wb.AddListGroup("", "lsg3", "我的文件下载列表")
Dim path As String = ProjectPath & "web\up\print\" & ksid & "\"
If FileSys.DirectoryExists(path) = False Then '如果目录C:\MyFolder存在
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, "").Replace("web\", ""), "./images/down.png")
Next
End If
End With
With wb.AddPageFooter("", "pf1", "")
.AddLink("返回首页", "default.htm")
End With
e.WriteString(wb.Build) '生成网页
End Select
[此贴子已经被作者于2022/11/28 15:07:13编辑过]