日期:2014-05-16 浏览次数:21034 次
Function getHTTPPage(url)
Dim Http
Set Http = Server.CreateObject("MSXML2.XMLHTTP")
Http.Open "GET", url, False
Http.send()
If Http.readystate <> 4 Then
Exit Function
End If
getHTTPPage = BytesToBstr(Http.responseBody, "GB2312")
Set Http = Nothing
If Err.Number <> 0 Then Err.Clear
End Function
Function BytesToBstr(body, Cset)
Dim objstream
Set objstream = Server.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
response.write getHTTPPage("http://sdk.kuai-xin.com:8888/sms.aspx?action=send&userid=12&account=账号&password=密码&mobile=15023239810,13527576163&content=内容&sendTime=")
set xmlhttp=Server.CreateObject("MSXML2.XMLHTTP")
URL="http://sdk.kuai-xin.com:8888/sms.aspx?action=send&userid=12&account=账号&password=密码&mobile=15023239810,13527576163&content=内容&sendTime="
xmlhttp.open "POST",URL, False
xmlhttp.send
if xmlhttp.readyState = 4 then
Set xmlDoc=Server.CreateObject("Microsoft.XMLDOM")
xmlDoc.loadXML(xmlhttp.responseText)
Set item=xmlDoc.getElementsByTagName("returnsms")
For i=0 To (item.Length-1)
Set returnstatus=item.Item(i).getElementsByTagName("returnstatus")
Set message=item.Item(i).getElementsByTagName("message")
Response.Write returnstatus.Item(0).Text
Response.Write message.Item(0).Text
Next
end if
end if