asp.net使用飞信fetionAPI接口免费发送短信的c#的实例
2010-08-07 02:39
846 查看
飞信免费发短信API接口调用方式(通过HTTP访问以下网址、支持GET和POST):(可用)
http://sms.api.bz/fetion.php?username=您的移动飞信登录手机号&password=您的移动飞信登录密码&sendto=接收短信的飞信好友手机号(也可以是你自己的手机号)&message=短信内容
注:短信内容最大长度为180个汉字,超过180个汉字不发送。返回的信息为UTF-8编码的中文文本信息。
2009年5月28日新增:飞信免费发短信API接口调用方式(通过HTTPS加密隧道访问以下网址、支持GET和POST,进一步保证您的密码安全):
下面的这条 我测试失败 根据验证过程,远程证书无效 大概是和https有关
https://sms.api.bz/fetion.php?username=您的移动飞信登录手机号&password=您的移动飞信登录密码&sendto=接收短信的飞信好友手机号(也可以是你自己的手机号)&message=短信内容
注:短信内容最大长度为180个汉字,超过180个汉字不发送。返回的信息为UTF-8编码的中文文本信息。
发送实例:C# CODE:
aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default"%>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN" “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>短信发送</title>
</head>
<body>
<form runat="server" id="form1">
<div style="height: 251px; width: 464px; font-size:12px;">
<font color="#ff6600">飞信免费发短信API接口调用方式(通过HTTP访问以下网址、支持GET和POST):</font><br />
<table style="width:100%;">
<tr>
<td class="style1">
您的手机/飞信号码</td>
<td>
<asp:TextBox ID="telFrom" runat="server" Width="203px"></asp:TextBox>
</td>
</tr>
<tr>
<td class="style1">
您的飞信登陆密码</td>
<td>
<asp:TextBox ID="telPwd" runat="server" TextMode="Password" Width="203px"></asp:TextBox>
</td>
</tr>
<tr>
<td class="style1">
接收信息的手机号码</td>
<td>
<asp:TextBox ID="toTel" runat="server" Width="203px"></asp:TextBox>
</td>
</tr>
<tr>
<td class="style1">
短信内容(最多180汉字)</td>
<td>
<asp:TextBox ID="content" runat="server" Text ="短信内容" Height="144px" Width="215px"></asp:TextBox>
</td>
</tr>
<tr>
<td class="style1">
<asp:Button ID="send" runat="server" Text="发送短信" OnClick="send_Click"
/>
</td>
<td>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
cs:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Net;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class _Default : System.Web.UI.Page
{
protected void send_Click(object sender, EventArgs e)
{
string fromNum = telFrom.Text; //发送的手机号
string pwd = telPwd.Text; //手机密码
string toNum = toTel.Text; //接收的手机号码
string contents = content.Text; //注意 这下面是 http协议 而没有用https 会报 根据验证过程,远程证书无效 的错误
string url = "http://sms.api.bz/fetion.php?username="+fromNum+"&password="+pwd+"&sendto=" + toNum + "&message=" + contents + "";
HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(url);
req.Method = "GET";
using (WebResponse wr = req.GetResponse())
{
Response.Write("短信发送成功!");
}
}
}
http://sms.api.bz/fetion.php?username=您的移动飞信登录手机号&password=您的移动飞信登录密码&sendto=接收短信的飞信好友手机号(也可以是你自己的手机号)&message=短信内容
注:短信内容最大长度为180个汉字,超过180个汉字不发送。返回的信息为UTF-8编码的中文文本信息。
2009年5月28日新增:飞信免费发短信API接口调用方式(通过HTTPS加密隧道访问以下网址、支持GET和POST,进一步保证您的密码安全):
下面的这条 我测试失败 根据验证过程,远程证书无效 大概是和https有关
https://sms.api.bz/fetion.php?username=您的移动飞信登录手机号&password=您的移动飞信登录密码&sendto=接收短信的飞信好友手机号(也可以是你自己的手机号)&message=短信内容
注:短信内容最大长度为180个汉字,超过180个汉字不发送。返回的信息为UTF-8编码的中文文本信息。
发送实例:C# CODE:
aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default"%>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN" “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>短信发送</title>
</head>
<body>
<form runat="server" id="form1">
<div style="height: 251px; width: 464px; font-size:12px;">
<font color="#ff6600">飞信免费发短信API接口调用方式(通过HTTP访问以下网址、支持GET和POST):</font><br />
<table style="width:100%;">
<tr>
<td class="style1">
您的手机/飞信号码</td>
<td>
<asp:TextBox ID="telFrom" runat="server" Width="203px"></asp:TextBox>
</td>
</tr>
<tr>
<td class="style1">
您的飞信登陆密码</td>
<td>
<asp:TextBox ID="telPwd" runat="server" TextMode="Password" Width="203px"></asp:TextBox>
</td>
</tr>
<tr>
<td class="style1">
接收信息的手机号码</td>
<td>
<asp:TextBox ID="toTel" runat="server" Width="203px"></asp:TextBox>
</td>
</tr>
<tr>
<td class="style1">
短信内容(最多180汉字)</td>
<td>
<asp:TextBox ID="content" runat="server" Text ="短信内容" Height="144px" Width="215px"></asp:TextBox>
</td>
</tr>
<tr>
<td class="style1">
<asp:Button ID="send" runat="server" Text="发送短信" OnClick="send_Click"
/>
</td>
<td>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
cs:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Net;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class _Default : System.Web.UI.Page
{
protected void send_Click(object sender, EventArgs e)
{
string fromNum = telFrom.Text; //发送的手机号
string pwd = telPwd.Text; //手机密码
string toNum = toTel.Text; //接收的手机号码
string contents = content.Text; //注意 这下面是 http协议 而没有用https 会报 根据验证过程,远程证书无效 的错误
string url = "http://sms.api.bz/fetion.php?username="+fromNum+"&password="+pwd+"&sendto=" + toNum + "&message=" + contents + "";
HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(url);
req.Method = "GET";
using (WebResponse wr = req.GetResponse())
{
Response.Write("短信发送成功!");
}
}
}
相关文章推荐
- asp.net使用飞信fetionAPI接口免费发送短信的c#的实例
- C#实现多级子目录Zip压缩解压实例 NET4.6下的UTC时间转换 [译]ASP.NET Core Web API 中使用Oracle数据库和Dapper看这篇就够了 asp.Net Core免费开源分布式异常日志收集框架Exceptionless安装配置以及简单使用图文教程 asp.net core异步进行新增操作并且需要判断某些字段是否重复的三种解决方案 .NET Core开发日志
- asp.net(c#) 下SQL存储过程使用详细实例
- 使用ASP发送飞信的免费短信
- 使用ASP发送飞信的免费短信
- 在Asp.Net中使用SmtpMail发送邮件的方法:实例
- asp.net(C#)使用QRCode生成图片中心加Logo或图像的二维码实例
- 如何使用 ASP.NET Web 服务和 Visual C# .NET 发送和接收二进制文档
- 使用ASP发送飞信的免费短信
- ASP.NET+C#使用JMail发送邮件
- 使用PHP免费发送定时短信的实例
- js_html_input中autocomplete="off"在chrom中失效的解决办法 使用JS模拟锚点跳转 js如何获取url参数 C#模拟httpwebrequest请求_向服务器模拟cookie发送 实习期学到的技术(一) LinqPad的变量比较功能 ASP.NET EF 使用LinqPad 快速学习Linq
- 使用ASP发送飞信的免费短信
- vs.net2005中使用利用cdo.message发送邮件(以asp.net/c#为例)
- 使用ASP发送飞信的免费短信
- 使用PHP免费发送定时短信的实例
- c# ASP.Net 使用开源免费类库操作Excel
- asp.net发送邮件,使用MD5加密解密,实现用户注册完成后发送流水号(账号)到对方邮箱,jeasyUI验证,combobox的使用完成 实例下载
- MVC使用ASP.NET Identity 2.0实现用户身份安全相关功能,比如通过短信或邮件发送安全码,账户锁定等