接口文檔
代碼示例
代碼下載asp代碼示例
在線技術(shù)支持
<%
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
%>
<%
'發(fā)送短信'
'accName 用戶名'
'accPwd 密碼'
'aimcodes 電話'
'content 內(nèi)容'
'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://www.iium.cn/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
<%
'查詢回執(zhí)報(bào)告'
'accName 用戶名'
'accPwd 密碼'
%>
Function qryReport()
password=UCase(md5(accPwd))
url="accName="+accName+"&accPwd="+password
Set HttpReq = Server.CreateObject("Microsoft.XMLHTTP")
HttpReq.open "post", "http://www.iium.cn/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://www.iium.cn/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://www.iium.cn/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 "電話號","測試內(nèi)容"
qryReport
qryBalance
receiveSms
%>
<%
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
Function GetSeed()
timeStr=now()
GetSeed=cstr(Year(timeStr))+cstr(Month(timeStr)) +cstr(Day(timeStr))+cstr(hour(timeStr))+cstr(Minute(timeStr))+cstr(Second(timeStr))
End Function
%>
<%
'發(fā)送短信'
'accName 用戶名'
'accPwd 密碼'
'aimcodes 電話'
'content 內(nèi)容'
'seed 當(dāng)前時(shí)間 格式:YYYYMMDD HHMISS 例如:20130806102030'
'sign 簽名'
%>
<%
accName="用戶名"
accPwd="密碼"
sign="簽名"
Function SendSms(mobiles,content)
seed=GetSeed()
password=UCase(md5(UCase(md5(accPwd)+seed)))
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/send2", 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
<%
'查詢回執(zhí)報(bào)告'
'accName 用戶名'
'accPwd 密碼'
'seed 當(dāng)前時(shí)間 格式:YYYYMMDD HHMISS 例如:20130806102030'
%>
Function qryReport()
seed=GetSeed()
password=UCase(md5(UCase(md5(accPwd)+seed)))
url="accName="+accName+"&accPwd="+password+"&seed="+seed
Set HttpReq = Server.CreateObject("Microsoft.XMLHTTP")
HttpReq.open "post", "http://sdk.lx198.com/sdk/qryReport2", 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 密碼'
'seed 當(dāng)前時(shí)間 格式:YYYYMMDD HHMISS 例如:20130806102030'
%>
Function qryBalance()
seed=GetSeed()
password=UCase(md5(UCase(md5(accPwd)+seed)))
url="accName="+accName+"&accPwd="+password+"&seed="+seed
Set HttpReq = Server.CreateObject("Microsoft.XMLHTTP")
HttpReq.open "post", "http://sdk.lx198.com/sdk/qryBalance2", 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 密碼'
'seed 當(dāng)前時(shí)間 格式:YYYYMMDD HHMISS 例如:20130806102030'
%>
Function receiveSms()
seed=GetSeed()
password=UCase(md5(UCase(md5(accPwd)+seed)))
url="accName="+accName+"&accPwd="+password
Set HttpReq = Server.CreateObject("Microsoft.XMLHTTP")
HttpReq.open "post", "http://sdk.lx198.com/sdk/receiveSms2", 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 "電話號","測試內(nèi)容"
qryReport
qryBalance
receiveSms
%>