云片短信平台ASP版程序网站使用方法
2017-10-23 20:56
246 查看
云片短信平台ASP版程序使用方法:
<%
@LANGUAGE="VBSCRIPT" CODEPAGE="65001"
response.contenttype = "text/html;charset=utf-8"
method = "POST"
mobile = Server.URLEncode("xxxxxxxxxxx") '您要发送的手机号
apikey = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" '修改为您的apikey(https://www.yunpian.com)登录官网后获取
text ="【云片网】您的验证码是1234" '发送内容
url_send_sms = "https://sms.yunpian.com/v2/sms/single_send.json"
data_send_sms = "apikey=" & apikey & "&mobile=" & mobile & "&text=" & text
response.write GetBody(url_send_sms,data_send_sms)
Function GetBody(url,data)
Set https = Server.CreateObject("MSXML2.ServerXMLHTTP")
With https
.Open method, url, False
.setRequestHeader "Content-Type","application/x-www-form-urlencoded"
.Send data
GetBody= .ResponseBody
End With
GetBody = bytetostr(https.ResponseBody,"utf-8")
Set https = Nothing
End Function
function bytetostr(vin,cset)
dim bs,sr
set bs = server.createObject("adodb.stream")
bs.type = 2
bs.open
bs.writetext vin
bs.position = 0
bs.charset = cset
bs.position = 2
sr = bs.readtext
bs.close
set bs = nothing
bytetostr = sr
end function
云片短信平台ASP版程序使用方法:
<%
@LANGUAGE="VBSCRIPT" CODEPAGE="65001"
response.contenttype = "text/html;charset=utf-8"
method = "POST"
mobile = Server.URLEncode("xxxxxxxxxxx") '您要发送的手机号
apikey = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" '修改为您的apikey(https://www.yunpian.com)登录官网后获取
text ="【云片网】您的验证码是1234" '发送内容
url_send_sms = "https://sms.yunpian.com/v2/sms/single_send.json"
data_send_sms = "apikey=" & apikey & "&mobile=" & mobile & "&text=" & text
response.write GetBody(url_send_sms,data_send_sms)
Function GetBody(url,data)
Set https = Server.CreateObject("MSXML2.ServerXMLHTTP")
With https
.Open method, url, False
.setRequestHeader "Content-Type","application/x-www-form-urlencoded"
.Send data
GetBody= .ResponseBody
End With
GetBody = bytetostr(https.ResponseBody,"utf-8")
Set https = Nothing
End Function
function bytetostr(vin,cset)
dim bs,sr
set bs = server.createObject("adodb.stream")
bs.type = 2
bs.open
bs.writetext vin
bs.position = 0
bs.charset = cset
bs.position = 2
sr = bs.readtext
bs.close
set bs = nothing
bytetostr = sr
end function
相关文章推荐
- 在asp.net网站程序中混合使用php页面的乱码问题
- ASP网站程序自动升级实现的方法
- ASP.NET网站伪静态下使用中文URL的方法
- [置顶] Ajax程序:处理异步调用中的异常(使用Asp.Net Ajax内建的异常处理方法)
- CentOS 6.5平台使用CLion开发程序,编译器支持C++11的方法
- ASP.NET一般处理程序新建一个方法里使用context.Response.Write的解决方法
- 网站安全之ASP程序加密解密方法全面解析
- 使用vs的性能分析asp.net程序时报错的解决方法 (转载)
- IIS网站或系统验证码不显示问题——"使用了托管的处理程序,但是未安装或未完整安装 ASP.NET"
- 解决ASP.NET使用IIS架设网站时“服务器应用程序不可用”的方法
- IIS网站或系统验证码不显示问题——"使用了托管的处理程序,但是未安装或未完整安装 ASP.NET"
- [解决方法]网络策略设置禁止您使用该网站获取您计算机的更新程序。 如果您确认此消息有误,请向您的系统管理员咨询。
- Ajax程序:处理异步调用中的异常(使用Asp.Net Ajax内建的异常处理方法)
- asp.net- ajax简单入门使用方法,通过一般处理程序ashx进行处理
- ASP.NET网站程序防SQL注入式攻击方法
- 使用VS2015开发asp程序让IIS express 允许的父路径的方法
- ASP网站程序自动升级实现的方法
- 未能将网站配置为使用ASP.NET4.X 解决方法
- ASP.NET 计划任务实现方法(不使用外接程序,.net内部机制实现)
- 两种方法在Visual Studio Win32控制平台程序中使用超过4G的内存