Foxtable(狐表)用户栏目专家坐堂 → 甜甜 帮帮忙


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

主题:甜甜 帮帮忙

美女呀,离线,留言给我吧!
qianqian1530
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:三尾狐 帖子:746 积分:5567 威望:0 精华:0 注册:2013/12/4 8:56:00
甜甜 帮帮忙  发帖心情 Post By: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


















不知道哪里错了...

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2014/3/5 22:18:00 [只看该作者]

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

 

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

 


 回到顶部
美女呀,离线,留言给我吧!
qianqian1530
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:三尾狐 帖子:746 积分:5567 威望:0 精华:0 注册:2013/12/4 8:56:00
  发帖心情 Post By:2014/3/5 22:23:00 [只看该作者]

索引超出了数组界限。..... 不知道为啥
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:231.zip



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

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By: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


 回到顶部