我用inet控件下载ftp上的文件,但是出现了一个问题,当正在下载中,我用鼠标点击其他地方时,就会出错,我用捕捉错误,说是“最后的请求再运行中”,我不知道是什莫意思,恳请高手指点,
我扶上我的代码
Private Sub Inet1_StateChanged(ByVal State As Integer)
On Error GoTo change_err
Case 12
Dim vtData As Variant
Dim bDone As Boolean
Dim l As Integer
bDone = False
' '取得第一个?。
vtData = Inet1.GetChunk(1024, icString)
DoEvents
Do While Not bDone
strdata = strdata & vtData
' '取得下一个?。
vtData = Inet1.GetChunk(1024, icString)
DoEvents
If Len(vtData) = 0 Then
bDone = True
End If
Loop
Form1.Caption = "求已完成,并且所有数据均已接收到"
end select
exit sub
change_err:
msgbox error(err)
end sub
每次出错时都指在 vtData = Inet1.GetChunk(1024, icString)(第一个)这一行,我该怎末作呢????
恳请回答,先谢谢了!!!
我扶上我的代码
Private Sub Inet1_StateChanged(ByVal State As Integer)
On Error GoTo change_err
Case 12
Dim vtData As Variant
Dim bDone As Boolean
Dim l As Integer
bDone = False
' '取得第一个?。
vtData = Inet1.GetChunk(1024, icString)
DoEvents
Do While Not bDone
strdata = strdata & vtData
' '取得下一个?。
vtData = Inet1.GetChunk(1024, icString)
DoEvents
If Len(vtData) = 0 Then
bDone = True
End If
Loop
Form1.Caption = "求已完成,并且所有数据均已接收到"
end select
exit sub
change_err:
msgbox error(err)
end sub
每次出错时都指在 vtData = Inet1.GetChunk(1024, icString)(第一个)这一行,我该怎末作呢????
恳请回答,先谢谢了!!!
On Error GoTo change_err
Case 12
Dim vtData As Variant
Dim bDone As Boolean
Dim l As Integer
bDone = False
' '取得第一个?。
DoEvents
Do While Not bDone
' '取得下一个?。
vtData = Inet1.GetChunk(1024, icString)
DoEvents
If Len(vtData) = 0 Then
bDone = True
End If
strdata = strdata & vtData
Loop
Form1.Caption = "求已完成,并且所有数据均已接收到"
end select
exit sub
change_err:
msgbox error(err)
end sub