Foxtable(狐表)用户栏目专家坐堂 → 代码请教版主


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

主题:代码请教版主

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


加好友 发短信
等级:超级版主 帖子:13837 积分:69650 威望:0 精华:0 注册:2016/11/1 14:42:00
  发帖心情 Post By:2017/1/11 16:36:00 [显示全部帖子]


 回到顶部
帅哥哟,离线,有人找我吗?
有点色
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:13837 积分:69650 威望:0 精华:0 注册:2016/11/1 14:42:00
  发帖心情 Post By:2017/1/11 17:08:00 [显示全部帖子]

Dim path As String = "d:\test\"
Dim ftp1 As New FtpClient
ftp1.Host="127.0.0.1"
ftp1.Account = "test"
ftp1.Password = "test"
ftp1.UTF8 = True

For Each dr As DataRow In DataTables("表A").Select("图纸号 is not null")
    Dim fpath As String = "/" & dr("图纸号") & "/"
    If ftp1.DirExists(path) = False Then ftp1.MakeDir(path)
    Dim str As String = ""
    For Each f As String In FileSys.GetFiles(path)
        If FileSys.GetName(f).StartsWith(dr("图纸号")) Then
            If ftp1.Upload(f, fpath & filesys.GetName(f)) = True Then
                str &= fpath & FileSys.GetName(f) & vbcrlf
                output.show("上传:" & filesys.GetName(f) & " 成功")
            Else
                output.show("上传:" & filesys.GetName(f) & " 失败")
            End If
        End If
    next
    dr("图片列") = str
Next
ftp1.close


 回到顶部
帅哥哟,离线,有人找我吗?
有点色
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:13837 积分:69650 威望:0 精华:0 注册:2016/11/1 14:42:00
  发帖心情 Post By:2017/1/12 9:35:00 [显示全部帖子]

Dim path As String = "d:\test\"
Dim ftp1 As New FtpClient
ftp1.Host="127.0.0.1"
ftp1.Account = "test"
ftp1.Password = "test"
ftp1.UTF8 = True

For Each dr As DataRow In DataTables("表A").Select("图纸号 is not null")
    Dim fpath As String = "/产品/" & dr("图纸号") & "/"
    If ftp1.DirExists(path) = False Then ftp1.MakeDir(path)
    Dim str As String = ""
    For Each f As String In FileSys.GetFiles(path)
        If FileSys.GetName(f).StartsWith(dr("图纸号")) Then
            If ftp1.Upload(f, fpath & filesys.GetName(f)) = True Then
                str &= fpath & FileSys.GetName(f) & vbcrlf
                output.show("上传:" & filesys.GetName(f) & " 成功")
            Else
                output.show("上传:" & filesys.GetName(f) & " 失败")
            End If
        End If
    next
    dr("图片列") = str
Next
ftp1.close


 回到顶部