执行测试wscript xxx.vbs
ScriptTimeout=999999
function sendsms(byval phone, byval sms)
dim r, url
'url = "http://202.85.214.57:30002/shttp.recmt?ua=jhtx&pw=332006&mobile="&phone&"&msg="&sms '正式上线前修改UA和PW。
url = "http://202.85.214.57:30002/shttp.recmt?ua=9hservice&pw=12345&mobile="&phone&"&msg="&sms '正式上线前修改UA和PW。
r = getHTTPPage(url)
r = lcase(r) '"<root><result>1</result><i>0007715261</i></root>"
r = replace(r,chr(10),"")
r = replace(r,chr(13),"")
r = replace(r," ","")
r = replace(r,"<root><result>","")
r = replace(r,"</i></root>","")
r = replace(r,"</result></root>","")
r = replace(r,"</result><i>","|")
sendsms = r
end function
function getHTTPPage(url)
dim Http
set Http=createobject("MSXML2.ServerXMLHTTP.6.0")
Http.setTimeouts 5000,5000,5000,10000
Http.open "GET",url,false
Http.send()
If Http.ReadyState = 4 And Http.Status = 200 then
getHTTPPage=bytesToBSTR(Http.responseBody,"GB2312")
else
getHTTPPage=""
end if
set http=nothing
if err.number<>0 then err.Clear
end function
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
function getUrl(url)
url = replace(url,"|","︱")
getUrl = getHTTPPage(url)
getUrl = replace(getUrl,chr(13)&chr(10),"")
getUrl = replace(getUrl,chr(10)&chr(13),"")
getUrl = replace(getUrl,chr(10),"")
getUrl = replace(getUrl,chr(13),"")
if instr(url,"prototype=14&type=3")<=0 and instr(url,"prototype=86&type=6")<=0 then
getUrl = replace(getUrl," ","")
end if
end function
call sendsms("13488802775","send Success")
call sendsms("18601152191","send Success")