如果图片不存在,你怎么处理?
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