Foxtable(狐表)用户栏目专家坐堂 → 上传带文件夹的图片


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

主题:上传带文件夹的图片

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


加好友 发短信
等级:二尾狐 帖子:524 积分:3676 威望:0 精华:0 注册:2012/7/27 10:28:00
  发帖心情 Post By:2016/5/23 21:12:00 [只看该作者]

这样可以吗?

 


 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  12楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/5/23 21:24:00 [只看该作者]

执行,报什么错?

[此贴子已经被作者于2016/5/23 21:24:01编辑过]

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


加好友 发短信
等级:二尾狐 帖子:524 积分:3676 威望:0 精华:0 注册:2012/7/27 10:28:00
  发帖心情 Post By:2016/5/23 21:26:00 [只看该作者]

没有报错,不过就是图片无法显示,不过也怪,最后一个图片成功显示,这是为什么?

查了FTP文件夹,有文件上传


 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  14楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/5/23 21:30:00 [只看该作者]

只会显示你上次成功的图片。只要你上传了图片,路径正确,肯定能显示的。

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


加好友 发短信
等级:二尾狐 帖子:524 积分:3676 威望:0 精华:0 注册:2012/7/27 10:28:00
  发帖心情 Post By:2016/5/23 21:31:00 [只看该作者]

知道原因了,在第八、第九、第十列不能加/A/

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


加好友 发短信
等级:二尾狐 帖子:524 积分:3676 威望:0 精华:0 注册:2012/7/27 10:28:00
  发帖心情 Post By:2016/5/24 17:42:00 [只看该作者]

Dim ftp1 As New FtpClient
ftp1.Host="021.6.net"
ftp1.Account = "user"
ftp1.Password = "654321"
Dim r As Row = Tables("表A").current
Dim l As String = "/A/"& r("第四列")
Dim f As String = "c:"& r("第八列")
Dim f1 As String = "c:"& r("第九列")
Dim f2 As String = "c:"& r("第十列")
Dim sf As String =  r("第八列")
Dim sf1 As String = r("第九列")
Dim sf2 As String = r("第十列")
If FileSys.DirectoryExists("c:/A/"& r("第四列") ) Then '如果指定的文件目录存在
    If  ftp1.DirExists("/A/"&("第四列") )  Then
        Messagebox.Show("FTP文件目录已经存在!","提示")
    Else
        If ftp1.MakeDir(l) Then
            Messagebox.Show("创建目录成功!")
            If  ftp1.Upload(f,sf) = True And ftp1.Upload(f1,sf1) = True And ftp1.Upload(f2,sf2) = True Then
                Messagebox.show("上传完成!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
            Else
                Messagebox.show("上传失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
            End If
            If DataTables("表A").HasChanges Then
                DataTables("表A").Save
            End If
        End If
    End If
    Messagebox.Show("源文件目录不存在!","提示")
End If

 

怎么不提示了?错在哪里了?

[此贴子已经被作者于2016/5/24 17:42:59编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  17楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/5/24 17:49:00 [只看该作者]

Dim ftp1 As New FtpClient
ftp1.Host="021.6.net"
ftp1.Account = "user"
ftp1.Password = "654321"
Dim r As Row = Tables("表A").current
Dim l As String = "/A/"& r("第四列")
Dim f As String = "c:"& r("第八列")
Dim f1 As String = "c:"& r("第九列")
Dim f2 As String = "c:"& r("第十列")
Dim sf As String =  r("第八列")
Dim sf1 As String = r("第九列")
Dim sf2 As String = r("第十列")
msgbox("c:/A/"& r("第四列"))
If FileSys.DirectoryExists("c:/A/"& r("第四列") ) Then '如果指定的文件目录存在
    If  ftp1.DirExists("/A/"&("第四列") )  Then
        Messagebox.Show("FTP文件目录已经存在!","提示")
    Else
        If ftp1.MakeDir(l) Then
            Messagebox.Show("创建目录成功!")
            If  ftp1.Upload(f,sf) = True And ftp1.Upload(f1,sf1) = True And ftp1.Upload(f2,sf2) = True Then
                Messagebox.show("上传完成!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
            Else
                Messagebox.show("上传失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
            End If
            If DataTables("表A").HasChanges Then
                DataTables("表A").Save
            End If
        Else
            msgbox("创建目录失败")
        End If
    End If
Else
    Messagebox.Show("源文件目录不存在!","提示")
End If

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


加好友 发短信
等级:二尾狐 帖子:524 积分:3676 威望:0 精华:0 注册:2012/7/27 10:28:00
  发帖心情 Post By:2016/5/24 17:51:00 [只看该作者]

Dim ftp1 As New FtpClient
ftp1.Host="021.66ip.net"
ftp1.Account = "byftpuser"
ftp1.Password = "654321"
Dim r As Row = Tables("表A").current
Dim l As String = "/A/"& r("第四列")
Dim f As String = "c:"& r("第八列")
Dim f1 As String = "c:"& r("第九列")
Dim f2 As String = "c:"& r("第十列")
Dim sf As String =  r("第八列")
Dim sf1 As String = r("第九列")
Dim sf2 As String = r("第十列")
If FileSys.DirectoryExists("c:/A/"& r("第四列") ) Then '如果指定的文件目录存在
    If  ftp1.DirExists(l)  Then
        Messagebox.Show("FTP文件目录已经存在!","提示")
 If  ftp1.Upload(f,sf) = True And ftp1.Upload(f1,sf1) = True And ftp1.Upload(f2,sf2) = True Then
                Messagebox.show("上传完成!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
            Else
                Messagebox.show("上传失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
            End If
            If DataTables("表A").HasChanges Then
                DataTables("表A").Save
            End If
       

    Else
        If ftp1.MakeDir(l) Then
            Messagebox.Show("创建目录成功!")
            If  ftp1.Upload(f,sf) = True And ftp1.Upload(f1,sf1) = True And ftp1.Upload(f2,sf2) = True Then
                Messagebox.show("上传完成!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
            Else
                Messagebox.show("上传失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
            End If
            If DataTables("表A").HasChanges Then
                DataTables("表A").Save
            End If
        End If
    End If
Else
    Messagebox.Show("源文件目录不存在!","提示")
End If

 

这个应该没问题了


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


加好友 发短信
等级:二尾狐 帖子:524 积分:3676 威望:0 精华:0 注册:2012/7/27 10:28:00
  发帖心情 Post By:2016/5/24 19:12:00 [只看该作者]

Dim ftp1 As New FtpClient
ftp1.Host="021.66ip.net"
ftp1.Account = "byftpuser"
ftp1.Password = "654321"
Dim r As Row = Tables("表A").current
Dim l As String = "/A/"& r("第四列")
Dim f As String = "c:"& r("第八列")
Dim f1 As String = "c:"& r("第九列")
Dim f2 As String = "c:"& r("第十列")
Dim sf As String =  r("第八列")
Dim sf1 As String = r("第九列")
Dim sf2 As String = r("第十列")
Messagebox.Show("请将源文件目录拷贝到C盘根目录下!","提示")
If FileSys.DirectoryExists("c:/A/"& r("第四列") ) Then '如果指定的文件目录存在
    If  ftp1.DirExists(l)  Then
        Messagebox.Show("服务器文件目录已经存在!","提示")
        If FileSys.FileExists(f) Then
            If  ftp1.Upload(f,sf) = True Then
                Messagebox.show("" &r("第四列")&" 1的上传完成!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
            Else
                Messagebox.show("" &r("第四列")&" 1的上传失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
            End If
        Else
            Messagebox.show("没有找到 " &r("第四列")&" 1的图片!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
        End If
        If FileSys.FileExists(f1) Then
            If  ftp1.Upload(f1,sf1) = True Then
                Messagebox.show("" &r("第四列")&" 2的上传完成!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
            Else
                Messagebox.show("" &r("第四列")&" 2的上传失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
            End If
        Else
            Messagebox.show("没有找到 " &r("第四列")&" 2的图片!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
        End If
        If FileSys.FileExists(f2) Then
            If  ftp1.Upload(f2,sf2) = True Then
                Messagebox.show("" &r("第四列")&" 3的银行卡图片上传完成!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
            Else
                Messagebox.show("" &r("第四列")&" 3的图片上传失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
            End If
        Else
            Messagebox.show("没有找到 " &r("第四列")&" 3的图片!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
        End If
        If DataTables("表A").HasChanges Then
            DataTables("表A").Save
        End If
    Else
        If ftp1.MakeDir(l) Then
            Messagebox.Show("创建目录成功!")
            If FileSys.FileExists(f) Then
                If  ftp1.Upload(f,sf) = True Then
                    Messagebox.show("" &r("第四列")&" 1的上传完成!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
                Else
                    Messagebox.show("" &r("第四列")&" 1的上传失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
                End If
            Else
                Messagebox.show("没有找到 " &r("第四列")&" 1的图片!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
            End If
            If FileSys.FileExists(f1) Then
                If  ftp1.Upload(f1,sf1) = True Then
                    Messagebox.show("" &r("第四列")&" 2的上传完成!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
                Else
                    Messagebox.show("" &r("第四列")&" 2的上传失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
                End If
            Else
                Messagebox.show("没有找到 " &r("第四列")&" 2的图片!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
            End If
            If FileSys.FileExists(f2) Then
                If  ftp1.Upload(f2,sf2) = True Then
                    Messagebox.show("" &r("第四列")&" 3的图片上传完成!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
                Else
                    Messagebox.show("" &r("第四列")&" 3的图片上传失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
                End If
            Else
                Messagebox.show("没有找到 " &r("第四列")&" 3的图片!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
            End If
            If DataTables("表A").HasChanges Then
                DataTables("表A").Save
            End If
        Else
            Messagebox.Show("创建目录失败,请联系管理员!")
        End If
    End If
Else
    Messagebox.Show("源文件目录不存在!","提示")
End If

 

这样应该是比较完美了,但是就是不是马上显示图片这是为什么?


 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  20楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/5/24 19:35:00 [只看该作者]

 把当前行切换到上一行,再切换回来就能显示。

 

 或者是,设置绑定列为nothing,然后再设置绑定列是对应的表列

 

http://www.foxtable.com/help/topics/1860.htm

 

 


 回到顶部
总数 32 上一页 1 2 3 4 下一页