Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Sub Command1_Click()
If Len(Text1) = 11 Then
Timer1.Enabled = True
Else
Beep
End If
End Sub
Private Sub Timer1_Timer()
Timer1.Enabled = False
Dim WinHttp As Object '声明一个对象
Set WinHttp = CreateObject("WinHttp.WinHttpRequest.5.1")
WinHttp.SetTimeouts 55000, 55000, 60000, 55000 '设置延时
WinHttp.Open "GET", "http://callback.tq.cn/callback/SendCall.do?uin=8008115&callPhone=0" + Text1, False
WinHttp.setRequestHeader "Referer", "http://callback.tq.cn/callback/PreSendCall.do"
WinHttp.setRequestHeader "User-Agent", "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)"
WinHttp.send
superSleep (10)
While WinHttp.Status <> 200
DoEvents
Wend
Timer1.Enabled = True
End Sub
Private Function BytesToBstr(body, Cset)
Dim objstream
Set objstream = CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode = 3
objstream.Open
objstream.write body
objstream.position = 0
objstream.Type = 2
objstream.Charset = Cset
BytesToBstr = objstream.ReadText
objstream.Close
Set objstream = Nothing
End Function
Public Function superSleep(DealyTime As Long)
Dim TimerCount As Single
TimerCount = Timer + DealyTime
While TimerCount - Timer > 0
DoEvents
Sleep (1)
Wend
End Function