以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  ftp的Download只能下载jpg文件吗?  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=145107)

--  作者:qwz405
--  发布时间:2020/1/8 16:16:00
--  ftp的Download只能下载jpg文件吗?
以下代码,只能下载jpg图片,txt/pdf下载不了,请求帮助!

    Dim ftp1 As new ftpclient
    ftp1.host = _ftp_Host
    ftp1.Account = _ftp_Account
    ftp1.password = _ftp_Password
    
    Dim num2 As Integer = 1   
    
    Dim lst As New List(of String)
    lst = dr.Lines("維修報告")
    For Each nm As String In lst
        output.show(nm)
        Dim num1 As Integer = nm.LastIndexOf(".")   
        Dim idx As String  = nm.SubString(num1)  
        
        If ftp1.Download(nm, ProjectPath & "Attachments\\ftpfile\\"& num2 &""& idx &"") = True Then    \'下載文件,并重命名
            num2 += 1
        End If
    Next

--  作者:有点蓝
--  发布时间:2020/1/8 16:26:00
--  
任何文件都可以下载
msgbox(ProjectPath & "Attachments\\ftpfile\\"& num2 &"" & idx &"")

If ftp1.Download(nm, ProjectPath & "Attachments\\ftpfile\\" & num2 & "." & idx) = True Then
--  作者:qwz405
--  发布时间:2020/1/8 16:53:00
--  
老师,您好。

上面的代码没有问题,是系统的问题。
因为程序在繁体系统中使用,文件名用中文就会乱码,就下载不了了。。。

--  作者:有点蓝
--  发布时间:2020/1/8 17:04:00
--  
那就不要使用中文,改为英文名称