567
社区成员




Function SendTo(Url, Msg)
Dim XmlHttp As Object
Static loops As Integer
loops = loops + 1
If loops = 5 Then '进行五次的发送尝试
Exit Function
End If
On Error Resume Next
Set XmlHttp = CreateObject("Msxml2.XMLHTTP")
If Not IsObject(XmlHttp) Then
Set XmlHttp = CreateObject("Microsoft.XMLHTTP")
If Not IsObject(XmlHttp) Then Exit Function
End If
XmlHttp.Open "POST", Url, False
XmlHttp.setRequestHeader "CONTENT-TYPE", "application/x-www-form-urlencoded"
XmlHttp.setRequestHeader "Connection", " Keep-Alive"
'XmlHttp.Send URLEncoding(Msg)
XmlHttp.Send Msg
If XmlHttp.Status <> 200 Then
Set XmlHttp = Nothing
DoEvents
SendTo Url, Msg '没成功继续发送
Else
MsgBox XmlHttp.responseText
Set XmlHttp = Nothing
Exit Function
End If
End Function
If XmlHttp.Status <> 200 Then
Set XmlHttp = Nothing
DoEvents
SendTo Url, Msg '没成功继续发送
'这里的Status<>200 并<>没有发送成功!
Else
。。。。。。
End If