以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  甜甜 帮帮忙  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=47185)

--  作者:qianqian1530
--  发布时间:2014/3/5 22:10:00
--  甜甜 帮帮忙
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


















不知道哪里错了...

--  作者:有点甜
--  发布时间:2014/3/5 22:18:00
--  

 呃,提示什么错?或者出现什么效果?

 

 你用msgbox测试一下 http://www.foxtable.com/help/topics/1485.htm

 


--  作者:qianqian1530
--  发布时间:2014/3/5 22:23:00
--  
索引超出了数组界限。..... 不知道为啥
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:231.zip



[此贴子已经被作者于2014-3-5 22:23:57编辑过]

--  作者:有点甜
--  发布时间:2014/3/5 23:08:00
--  

 测试了一下,改成这样,你的图片过多,可能会比较慢一些。

 

application.Doevents
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(i, Key)
            Dim vr As  WinForm.ListViewRow =  lvw.Rows.Add()
            vr.ImageKey = i
            application.Doevents
        Else
           
        End If
    Next
    lvw.ResumeRedraw() \'恢复绘制
End If