使用ASP发送飞信的免费短信
2012-05-16 08:59
537 查看
要实现在asp网站上发送飞信,要求是中国移动的手机用户,并且开通移动飞信功能。
使用以下asp代码,修改参数为你的手机号及飞信密码,就可以实现在网站发免费短信功能。
fsend.asp文件源代码如下:
<%
Dim fno,fp,tofno,rurl
fno="138xxxxxxxx" '手机号
fp="xxxxxxxx" '飞信密码
tofno="137xxxxxxxx" '发送目标手机号(要求是自己的号码或飞信好友)
rurl="" '提交后转移到的目标地址(留空将不转移)
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>请留下你的联系信息</title>
</head>
<body style="font-size: 10pt; font-family: 宋体">
<%if (Request("msg")="") then%>
<form method="POST" action="fsend.asp">
<br>请留下你的联系信息<br>
<hr>
联系信息:<br><textarea rows="5" name="msg" cols="27"></textarea><br>
<p><input type="submit" value="提交" name="B1"></p>
</form>
<%
else
Dim returnString
Dim msg
msg=Request("msg")
returnString=sendf(fno,fp,tofno,msg)
if rurl="" then
Response.Write returnString&"<br><a href='fsend.asp'>返回</a>"
else
Response.Redirect rurl
end if
end if
%>
</body>
</html>
<%
function sendf(fno,fp,tofno,msg)
'函数参数说明:fno=登录手机号,fp=登录密码,tofno=目标手机号,msg=要发送的信息
Dim returnString
Dim SoapRequest
Dim SoapURL
SoapURL = "http://io.feirobot.cn/send.aspx?fno="&fno&"&fp="&fp&"&tofno="&tofno&"&msg="&msg
Set SoapRequest = Server.CreateObject("MSXML2.XMLHTTP")
SoapRequest.Open "GET",SoapURL,False
SoapRequest.Send
returnString=bytes2bstr(SoapRequest.responsebody)
sendf=returnString
end function
function bytes2bstr(vin)
strreturn = ""
for i = 1 to lenb(vin)
thischarcode = ascb(midb(vin,i,1))
if thischarcode < &h80 then
strreturn = strreturn & chr(thischarcode)
else
nextcharcode = ascb(midb(vin,i+1,1))
strreturn = strreturn & chr(clng(thischarcode) * &h100 + cint(nextcharcode))
i = i + 1
end if
next
bytes2bstr = strreturn
end function
%>
使用以下asp代码,修改参数为你的手机号及飞信密码,就可以实现在网站发免费短信功能。
fsend.asp文件源代码如下:
<%
Dim fno,fp,tofno,rurl
fno="138xxxxxxxx" '手机号
fp="xxxxxxxx" '飞信密码
tofno="137xxxxxxxx" '发送目标手机号(要求是自己的号码或飞信好友)
rurl="" '提交后转移到的目标地址(留空将不转移)
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>请留下你的联系信息</title>
</head>
<body style="font-size: 10pt; font-family: 宋体">
<%if (Request("msg")="") then%>
<form method="POST" action="fsend.asp">
<br>请留下你的联系信息<br>
<hr>
联系信息:<br><textarea rows="5" name="msg" cols="27"></textarea><br>
<p><input type="submit" value="提交" name="B1"></p>
</form>
<%
else
Dim returnString
Dim msg
msg=Request("msg")
returnString=sendf(fno,fp,tofno,msg)
if rurl="" then
Response.Write returnString&"<br><a href='fsend.asp'>返回</a>"
else
Response.Redirect rurl
end if
end if
%>
</body>
</html>
<%
function sendf(fno,fp,tofno,msg)
'函数参数说明:fno=登录手机号,fp=登录密码,tofno=目标手机号,msg=要发送的信息
Dim returnString
Dim SoapRequest
Dim SoapURL
SoapURL = "http://io.feirobot.cn/send.aspx?fno="&fno&"&fp="&fp&"&tofno="&tofno&"&msg="&msg
Set SoapRequest = Server.CreateObject("MSXML2.XMLHTTP")
SoapRequest.Open "GET",SoapURL,False
SoapRequest.Send
returnString=bytes2bstr(SoapRequest.responsebody)
sendf=returnString
end function
function bytes2bstr(vin)
strreturn = ""
for i = 1 to lenb(vin)
thischarcode = ascb(midb(vin,i,1))
if thischarcode < &h80 then
strreturn = strreturn & chr(thischarcode)
else
nextcharcode = ascb(midb(vin,i+1,1))
strreturn = strreturn & chr(clng(thischarcode) * &h100 + cint(nextcharcode))
i = i + 1
end if
next
bytes2bstr = strreturn
end function
%>
相关文章推荐
- 使用ASP发送飞信的免费短信
- 使用ASP发送飞信的免费短信
- 使用ASP发送飞信的免费短信
- 使用ASP发送飞信的免费短信
- asp.net使用飞信fetionAPI接口免费发送短信的c#的实例
- asp.net使用飞信fetionAPI接口免费发送短信的c#的实例
- 程序调用飞信API发送免费短信(JAVA例子,其他语言一样用)
- 使用PHP免费发送定时短信的实例
- 使用 google 日历给自己发送免费天气预报短信
- 使用PhP免费发送定时短信(用于天气预报、定时提醒、短信祝福等等)
- 发送飞信免费短信API
- linux命令行下用Fetion飞信发送免费短信
- 程序调用飞信API发送免费短信(JAVA例子,其他语言一样用)
- 使用PHP免费发送定时短信的实例
- MVC使用ASP.NET Identity 2.0实现用户身份安全相关功能,比如通过短信或邮件发送安全码,账户锁定等
- API获取天气预报,以及使用飞信API,给好友发送短信
- c#用飞信免费发送短信
- 在Linux中使用飞信发送手机短信
- 飞信PHP接口|飞信PHP API免费发送手机短信接口,thinkphp发送单条函数
- 程序调用飞信API发送免费短信(JAVA例子,其他语言一样用)