• 顶信短信开发者帮助文档
    16年技术积累·10万客户选择

代码示例

代码下载asp代码示例  在线技术支持

	<%
	Function BytesToBstr(body,code) 
	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 =code
	BytesToBstr = objstream.ReadText 
	objstream.Close 
	set objstream = nothing 
	End Function
	%>

	<%
	'response.ContentType="text/xml;charset=UTF-8'
	%>
	
<% Function UrlEncoding(DataStr) Dim StrReturn,Si,ThisChr,InnerCode,Hight8,Low8 StrReturn = "" For Si = 1 To Len(DataStr) ThisChr = Mid(DataStr,Si,1) If Abs(Asc(ThisChr)) < &HFF Then StrReturn = StrReturn & ThisChr Else InnerCode = Asc(ThisChr) If InnerCode < 0 Then InnerCode = InnerCode + &H10000 End If Hight8 = (InnerCode And &HFF00)\ &HFF Low8 = InnerCode And &HFF StrReturn = StrReturn & "%" & Hex(Hight8) & "%" & Hex(Low8) End If Next UrlEncoding = StrReturn End Function %> <% '发送短信' 'accName 用户名' 'accPwd 密码' 'aimcodes 电话' 'content 内容' 'sign 签名' %> <% accName="用户名" accPwd="密码" sign="签名" Function SendSms(mobiles,content) password=UCase(md5(accPwd)) url="accName="+accName+"&accPwd="+password+"&aimcodes="+mobiles+"&content="+content+sign+"&seed="+seed Set HttpReq = Server.CreateObject("Microsoft.XMLHTTP") HttpReq.open "post", "http://sdk.lx198.com/sdk/send", False,"","" HttpReq.setRequestHeader "Content-Length",len(url) HttpReq.setRequestHeader "Content-Type", "application/x-www-form-urlencoded;charset=UTF-8" url=URLEncoding(url) HttpReq.send(url) str=HttpReq.responseText response.Write str End Function <% '查询回执报告' 'accName 用户名' 'accPwd 密码' %> Function qryReport() password=UCase(md5(accPwd)) url="accName="+accName+"&accPwd="+password Set HttpReq = Server.CreateObject("Microsoft.XMLHTTP") HttpReq.open "post", "http://sdk.lx198.com/sdk/qryReport", False,"","" HttpReq.setRequestHeader "Content-Length",len(url) HttpReq.setRequestHeader "Content-Type", "application/x-www-form-urlencoded;charset=UTF-8" url=URLEncoding(url) HttpReq.send(url) str=HttpReq.responseText response.Write str End Function <% '查询余额' 'accName 用户名' 'accPwd 密码' %> Function qryBalance() password=UCase(md5(accPwd)) url="accName="+accName+"&accPwd="+password Set HttpReq = Server.CreateObject("Microsoft.XMLHTTP") HttpReq.open "post", "http://sdk.lx198.com/sdk/qryBalance", False,"","" HttpReq.setRequestHeader "Content-Length",len(url) HttpReq.setRequestHeader "Content-Type", "application/x-www-form-urlencoded;charset=UTF-8" url=URLEncoding(url) HttpReq.send(url) str=HttpReq.responseText response.Write str End Function <% '查询上行短信' 'accName 用户名' 'accPwd 密码' %> Function receiveSms() password=UCase(md5(accPwd)) url="accName="+accName+"&accPwd="+password Set HttpReq = Server.CreateObject("Microsoft.XMLHTTP") HttpReq.open "post", "http://sdk.lx198.com/sdk/receiveSms", False,"","" HttpReq.setRequestHeader "Content-Length",len(url) HttpReq.setRequestHeader "Content-Type", "application/x-www-form-urlencoded;charset=UTF-8" url=URLEncoding(url) HttpReq.send(url) str=HttpReq.responseText response.Write str End Function SendSms "电话号","测试内容" qryReport qryBalance receiveSms %>

客服热线:400-6699-521

客服热线:400-6699-521