用api GetCountTick
dim blnRet as boolean
---------------------------
Winsock_DataArrival()
'你的代码
blnRet=ture '有数据到达
end sub-------------------------
'send data 模块
dim a as long
dim b as long '延时的时间
b=30000 '延时30秒
winsock.senddata "aaa"
blnret=false
a=getcounttick
do
doevents '一定要加
if blnret=ture then exit do
if a<getcounttick-b then
msgbox "超时"
winsock.close
exit do
end if
loop看懂了吗?通过上面的代码可以实现超时
dim blnRet as boolean
---------------------------
Winsock_DataArrival()
'你的代码
blnRet=ture '有数据到达
end sub-------------------------
'send data 模块
dim a as long
dim b as long '延时的时间
b=30000 '延时30秒
winsock.senddata "aaa"
blnret=false
a=getcounttick
do
doevents '一定要加
if blnret=ture then exit do
if a<getcounttick-b then
msgbox "超时"
winsock.close
exit do
end if
loop看懂了吗?通过上面的代码可以实现超时
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货