用VB编写异步多线程下载程序
来源:互联网
作者:西部数码
时间:2008-04-09
西部数码-全国虚拟主机10强!40余项虚拟主机管理功能,全国领先!双线多线虚拟主机南北访问畅通无阻!免费赠送企业邮局,.CN域名,自助建站480元起,免费试用7天,满意再付款! P4主机租用799元/月.月付免压金!
End Select
End Sub
Private Sub Inet2_StateChanged(ByVal State As Integer)
...
end sub
...
线程调度子程序,g和是k公用变量,k为最后一个链接的数组索引加一,g初值为零,每次加一,直到处理完最后一个链接。
Private Sub devjob()
If Not g 1 < k Then GoTo reportline
If Inet1.StillExecuting = False Then
g = g 1
Inet1.Execute links(g), "GET"
End If
If Not g 1 < k Then GoTo reportline
If Inet2.StillExecuting = False Then
g = g 1
Inet2.Execute links(g), "GET"
End If
...
reportline:
If Inet1.StillExecuting = False And Inet2.StillExecuting = False And ... Then
MsgBox ("下载结束。")
End If
End Sub
文章整理:西部数码--专业提供域名注册、虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!



