asp 문자 인터페이스 원본 코드는 비교적 간단하지만 실용적이다 (두 가지 쓰기)

2411 단어
쓰기 1:
 
  
Sub sendsms(mobile,msg)
' , , “,” , ,
' HttpInterfaceMore.aspx , webservers
dim userid,password,username,sms,status
dim xmlObj,httpsendurl
'
sms=" "
username=" "
userid = " ID"
password = " "

httpsendurl="http://jiekou.56dxw.com/sms/HttpInterface.aspx?
comid="&userid&"&username="&username&"&userpwd="&password&"&handtel="&mobile&"
&sendcontent="&server.URLEncode(msg)&"&sendtime=&smsnumber="&sms
Set xmlObj = server.CreateObject("Microsoft.XMLHTTP")
xmlObj.Open "POST",httpsendurl,false
xmlObj.send()
status = xmlObj.responseText
Set xmlObj = nothing
If status = "1" then '
Response.Write "

:"&status&"    : !    href=""javascript:history.back();''> 전송 페이지로 돌아가기"
Else '
Response.Write "

:"&status&"    : !   href=""javascript:history.back();''> 전송 페이지로 돌아가기"
End if
End sub
%>

서법 2
 
  
Function SendSms(UserName, UserPass, DstMobile, SmsMsg)
Dim http,msg,strUrl,RndNumber
set http = Server.CreateObject("Microsoft.XMLHTTP")
strurl="http://jiekou.56dxw.com/sms/HttpInterface.aspx?comid=121&username="&SmsName&"&userpwd="&SmsPw&"
&sendtime=&smsnumber=1065&handtel="&DstMobile&"&sendcontent="&server.URLEncode(SmsMsg)
http.Open "GET",strUrl, false
http.setRequestHeader "Content-type:", "text/xml;charset=GB2312"
http.Send
msg=http.ResponseText
set http = nothing
'
If msg="1" then
SendSms="OK"
else
sendSms="ERR"
end IF
End Function
%>

좋은 웹페이지 즐겨찾기