VB中inet控件的用法? 150

PrivateSubInet1_StateChanged(ByValStateAsInteger)OnErrorGoTovberr1DimbinBuffer()AsByt... Private Sub Inet1_StateChanged(ByVal State As Integer)
On Error GoTo vberr1
Dim binBuffer() As Byte
Dim sngProgerssValue As Single
Dim iBlock As Long

On Error Resume Next
iBlock = 0

Select Case State

Case icResponseCompleted
Open App.path & "\" & downName For Binary Access Write As #1
Do
DoEvents
binBuffer = Inet1.GetChunk(512, icByteArray)
iBlock = iBlock + 1
If m_lngDocSize > 0 Then
sngProgerssValue = Int((iBlock * 512 / m_lngDocSize) * 100)
fzt.Caption = "已下载 " & CStr(iBlock * 512) & " 字节 (" & CStr(sngProgerssValue) & "%)"
P.Value = sngProgerssValue
Put #1, , binBuffer()
End If
Loop Until iBlock * 512 >= m_lngDocSize
Close #1
zxqk.Text = "下载完成!"
If Right(www2.Text, 3) = "rar" Then Call setup_Click

Case icResponseReceived
If m_lngDocSize = 0 Then
If Len(Inet1.GetHeader("Content-Length")) > 0 Then
m_lngDocSize = CLng(Inet1.GetHeader("Content-Length"))
If (m_lngDocSize = 0) Then
fzt.Caption = ""
Call start
End If
Else
fzt.Caption = ""
Call start
End If
End If
Case icHostResolvingHost
zzt.Caption = "正在查询所指定的主机的 IP 地址"
Case icHostResolved
zzt.Caption = "成功地找到所指定的主机的 IP 地址"
Case icConnecting
zzt.Caption = "正在与主机连接"
Case icConnected
zzt.Caption = "已与主机连接成功"
Case icRequesting
zzt.Caption = "正在向主机发送请求"
Case icRequestSent
zzt.Caption = "发送请求已成功"
Case icReceivingResponse
zzt.Caption = "在接收主机的响应"
Case icResponseReceived
zzt.Caption = "成功地接收到主机的响应"
Case icDisconnecting
zzt.Caption = "正在解除与主机的连接"
Case icDisconnected
zzt.Caption = "已成功地与主机解除了连接"
Case icError
zzt.Caption = "与主机通讯时出现了错误"
End Select
Exit Sub
vberr1:
MsgBox "测试失败!", vbOKOnly + vbCritical, "提示!"
MsgBox "原因:" & Err.Description, vbOKOnly + vbCritical, "提示!"
End Sub

为什么我用Inet1.OpenURL wwwbb + www + wwwcc + "system.txt"打开文本文件的时侯,如果加上以上代码(主要用来在线升级下截rar类文件),就会卡住呢,大侠们有什么好的办法啊?
是有时会卡住,我把这段代码删除就好了,是不是要加个延时之类的东东啊,大侠帮帮忙啊?
展开
 我来答
qhbboy
2010-06-08 · TA获得超过564个赞
知道答主
回答量:156
采纳率:0%
帮助的人:93.2万
展开全部
VB早就过时了。回答完毕
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 1条折叠回答
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式