Foxtable(狐表)用户栏目专家坐堂 → ftp上传突然不能用了


  共有2713人关注过本帖平板打印复制链接

主题:ftp上传突然不能用了

帅哥哟,离线,有人找我吗?
cd_tdh
  1楼 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:狐精 帖子:3147 积分:20966 威望:0 精华:0 注册:2016/3/28 16:57:00
ftp上传突然不能用了  发帖心情 Post By:2019/12/27 10:40:00 [只看该作者]

老师,我用按钮通过ftp上传文件,突然不能不用了,麻烦看看什么问题,之前一直正常,而且我通过表格直接点上传,连接都没问题。

Dim dlg As New openFileDialog '定义一个新的SaveFileDialog
dlg.MultiSelect = True
If dlg.showDialog = DialogResult.Ok Then '如果用户单击了确定按钮
    Dim ftp1 As new  ftpclient
    ftp1.host=""
    ftp1.Account = ""
    ftp1.password = ""
    Dim r As Row = Tables("采购合同管理").Current
    Dim ls = r.DataRow.Lines("采购合同扫描件")
    For Each f As String In dlg.FileNames
        Dim file = "/采购合同管理/" & r("项目名称") & "/" & r("序号") & "/" & filesys.GetName(f)
        If ftp1.DirExists("/采购合同管理/" & r("项目名称")) = False Then
            ftp1.MakeDir("/采购合同管理/" & r("项目名称"))
        End If
        If ftp1.DirExists("/采购合同管理/" & r("项目名称") & "/" & r("序号")) = False Then
            ftp1.MakeDir("/采购合同管理/" & r("项目名称") & "/" & r("序号"))
        End If
        Dim Result As DialogResult
        If ftp1.FileExists(file) Then
            Result = MessageBox.Show("文件已经存在,是否覆盖?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
        End If
        If result = Nothing OrElse result = DialogResult.Yes Then
            If  ftp1.Upload(f,file,True) = True Then
                If ls.contains(file) = False Then
                    ls.add(file)
                End If
            Else
                MessageBox.Show( f & "上传失败" ,"提示" ,MessageBoxButtons.OK,MessageBoxIcon.Question)
            End If
        End If
    Next
    r.DataRow.lines("采购合同扫描件") = ls
    ftp1.Close
End If


 回到顶部