ASP如何获取短信验证码
2018-03-20 15:50
417 查看
案例:创蓝253云通讯平台的短信验证码接口demo---ASP
<%@LANGUAGE="VBSCRIPT"CODEPAGE="65001"%>
<%
Function Post(url,data)
dimHttps
setHttps=server.createobject("MSXML2.XMLHTTP")
Https.open"POST",url,false
Https.setRequestHeader"Content-Type","application/x-www-form-urlencoded"
Https.senddata
ifHttps.readystate=4 then
dimobjstream
setobjstream = Server.CreateObject("adodb.stream")
objstream.Type= 1
objstream.Mode=3
objstream.Open
objstream.WriteHttps.responseBody
objstream.Position= 0
objstream.Type= 2
objstream.Charset= "utf-8"
Post= objstream.ReadText
objstream.Close
setobjstream = nothing
sethttps=nothing
endif
End Function
dim target,post_data
target = "http://222.73.117.156/msg/HttpBatchSendSM"
post_data = "account=创蓝账号&pswd=创蓝密码&mobile=手机号&msg="&Server.URLEncode("短信测试")&"&needstatus=true&extno="
response.Write(Post(target,post_data))
''//请自己解析Post(target,post_data)返回的字符串并实现自己的逻辑
''第一行xxxxxxx,0表示成功,其它的参考http.doc文档
%>
<%@LANGUAGE="VBSCRIPT"CODEPAGE="65001"%>
<%
Function Post(url,data)
dimHttps
setHttps=server.createobject("MSXML2.XMLHTTP")
Https.open"POST",url,false
Https.setRequestHeader"Content-Type","application/x-www-form-urlencoded"
Https.senddata
ifHttps.readystate=4 then
dimobjstream
setobjstream = Server.CreateObject("adodb.stream")
objstream.Type= 1
objstream.Mode=3
objstream.Open
objstream.WriteHttps.responseBody
objstream.Position= 0
objstream.Type= 2
objstream.Charset= "utf-8"
Post= objstream.ReadText
objstream.Close
setobjstream = nothing
sethttps=nothing
endif
End Function
dim target,post_data
target = "http://222.73.117.156/msg/HttpBatchSendSM"
post_data = "account=创蓝账号&pswd=创蓝密码&mobile=手机号&msg="&Server.URLEncode("短信测试")&"&needstatus=true&extno="
response.Write(Post(target,post_data))
''//请自己解析Post(target,post_data)返回的字符串并实现自己的逻辑
''第一行xxxxxxx,0表示成功,其它的参考http.doc文档
%>
相关文章推荐
- ASP如何获取真实IP地址
- 负载均衡的场景下ASP.NET Core如何获取客户端IP地址
- asp.net 如何获取html控件select
- ASP.NET中的treeview中如何获取该子节点的所有父节点
- Asp.net web Api源码分析-如何获取IHttpHandler
- 如何用JS获取ASP.net中的textbox的值 js获不到text值
- 如何用ASP来获取网卡的MAC地址
- asp.net服务端代码如何获取客户端控件的值?
- ASP.NET中如何获取客户端浏览器信息
- ASP如何获取真实IP地址
- Android如何通过手机自动获取短信验证码
- ASP.NET 如何获取地址栏URL地址
- ASP.NET(C#)中如何获取IP,名称,操作系统,浏览器等信息
- asp.net中如何利用反射获取动态变量名称
- ASP如何获取客户端真实IP地址
- Asp.net中从后台中如何获取html控件的值?
- ASP如何获取客户端真实IP地址
- ASP如何获取真实IP地址
- asp.net如何获取IP
- Silverlight应用程序中如何获取ASP.NET页面参数