Dim lvw As WinForm.ListView = e.Form.Controls("ListView1")
Dim dt As DataTable
lvw.Rows.Clear() '清除原来的行
lvw.Images.Clear() '清除原来的图片
lvw.View = ViewMode.SmallIcon '用小图标模式
Dim cmd As new sql command
cmd.Connec ti
cmd.Comman dText="select * fr o m {审核管理} where 审核编号='" & lst.Table.Current("计划编码") & "' and 审批意见='同意'"
dt=cmd.Ex ecut eR eader
Dim fd2 As String
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
End If
'For Each dr As DataRow In dt.DataRows
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" '指定图标键值
End If
Next
这段代码提示“未将对象引用设置到对象的实例”