Foxtable(狐表)用户栏目专家坐堂 → ftp问题,请教


  共有2716人关注过本帖树形打印复制链接

主题:ftp问题,请教

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


加好友 发短信
等级:超级版主 帖子:109200 积分:555620 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2019/7/29 9:50:00 [显示全部帖子]

Dim r As Row = Tables("文档表").Current
If r IsNot Nothing Then
    Dim ftp1 As New FtpClient
    ftp1.Host="47.91.11.151"
    ftp1.Account = "ftpuser"
    ftp1.Password = "ftp@163"
    
    For Each fl As String In r.DataRow.Lines("附件")
        Dim file As String = _xmml & "\附件区\" & fl
        If ftp1.FileExists(file) Then '如果存在则删除
            If ftp1.DeleteFile(file) = True Then '这里要带路径的
                Messagebox.show("ftp文档" & fl & "删除成功!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
            Else
                Messagebox.show("ftp文档" & fl & "删除失败,请管理员手动删除!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
            End If
        Else
            messagebox.Show("ftp文档" & fl & "不存在!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
        End If
    Next
    r.Delete
End If

 回到顶部