application.Doevents
Dim pb As WinForm.PictureBox
Dim ftp1 As New FtpClient
Dim fls As List(of String)
ftp1.Host="hl231083.happywinds.net"
ftp1.Account = "hl231083"
ftp1.Password = "L8QVedzj"
fls = ftp1.GetFileList("\web\" & e.Node.FullPath )
If fls.Count>0 Then
Dim count As Integer=IIF(fls.count>20,20,fls.count)
Dim l As Integer
Dim lvw As WinForm.ListView = e.Form.Controls("ListView1")
lvw.StopRedraw() '暂停绘制
lvw.Rows.Clear() '清除原来的行
lvw.Images.Clear() '清除原来的图片
lvw.View = ViewMode.LargeIcon '显示模式为大图标
For i As Integer=0 To count-1
If ftp1.Download("\web\" & e.Node.FullPath & "\" & fls(i),"temp.jpg") = True Then
Dim Key As String ="temp.jpg"
lvw.Images.AddLargeImage(Key(i), Key)
Dim vr As WinForm.ListViewRow = lvw.Rows.Add()
vr.ImageKey = Key(i)
application.Doevents
l=l+1
Else
End If
Next
lvw.ResumeRedraw() '恢复绘制
End If
If Not (pb.Image Is Nothing) Then '释放内存
pb.Image.Dispose()
pb.Image = Nothing
End If
不知道哪里错了...