Foxtable(狐表)用户栏目专家坐堂 → 添加图片还是有问题


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

主题:添加图片还是有问题

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


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

 如果图片不存在,你怎么处理?

 

For Each dr As DataRow In dt.DataRows '列出所有
    If dr("签字位置") IsNot Nothing Then
        fd2 = ProjectPath & "Attachments\Images\" & dr("审核人账号") & "100user.png"
        If FileSys.FileExists(fd2)=False Then '如果指定的文件存在
            Dim ftp1 As New FtpClient
            ftp1.Host="192.168.254.202"
            ftp1.Port="21"
            ftp1.Account = "fox"
            ftp1.Password = "*******"
            If ftp1.FileExists(dr("签字位置")) Then '如果文件存在
                '     FileSys.DeleteFile(fd2,2,2) '则彻底删除之
                '    End If
                ftp1.Download(dr("签字位置"),fd2,False)
                ' FileSys.CopyFile(dr("大头像"),fd2 ,True)
            End If
            lvw.Images.AddSmallImage(ProjectPath & "Attachments\Images\" & dr("审核人账号") & "100user",ProjectPath & "Attachments\Images\" & dr("审核人账号") & "100user.png") '添加小图标
            Dim r As  WinForm.ListViewRow =  lvw.Rows.Add() '增加一行
            r.Text = dr("审批时间") '指定标题
            r.ImageKey = ProjectPath & "Attachments\Images\" & dr("审核人账号") & "100user.png" '指定图标键值

        Else

           '你怎么处理?
        End If
    End If
Next


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


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

For Each dr As DataRow In dt.DataRows '列出所有
    If dr("签字位置") IsNot Nothing Then
        fd2 = ProjectPath & "Attachments\Images\" & dr("审核人账号") & "100user.png"
        Dim ftp1 As New FtpClient
        ftp1.Host="192.168.254.202"
        ftp1.Port="21"
        ftp1.Account = "fox"
        ftp1.Password = "*******"
        If ftp1.FileExists(dr("签字位置")) Then '如果文件存在
            ftp1.Download(dr("签字位置"),fd2,False)
        End If
        ftp1.close
        If FileSys.FileExists(fd2)=False Then '如果指定的文件存在
            lvw.Images.AddSmallImage(fd2, fd2) '添加小图标
            Dim r As  WinForm.ListViewRow =  lvw.Rows.Add() '增加一行
            r.Text = dr("审批时间") '指定标题
            r.ImageKey = fd2
        Else
            msgbox("不存在对应的图片文件")
        End If
    End If
Next

 回到顶部