以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  求助,打开文件时弹出下载文件对话框  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=196485)

--  作者:873773115
--  发布时间:2025/5/4 17:23:00
--  求助,打开文件时弹出下载文件对话框
 老师。用下面代码打开文件时,如果本地存在文件,则不会正常显示,而是弹出一个是否保存,或者打开对话框是
图片点击可在新窗口打开查看此主题相关图片如下:1746350507864.png
图片点击可在新窗口打开查看
怎么回事?
       

    sr = ProjectPath & "RemoteFiles\\文件\\" & r("名称")
            
            If FileSys.FileExists(sr) = False Then
                Dim ftp As New FtpClient
                ftp.Host = Vars("ip")
                ftp.Account = "ftpuser"
                ftp.Password = "a545586820."
                ftp.ChangeDir("\\财务\\客户")
                ftp.Download(r("名称"), sr, True)
                
                If ftp.Download(r("名称"), sr, True) = False Then
                    MessageBox.Show("下载失败", "提醒")
                    Return
                End If
            End If
            e.Form.Controls("Wer").Address = sr