华域联盟 .Net asp.net调用飞信免费发短信(测试有效)

asp.net调用飞信免费发短信(测试有效)

复制代码 代码如下:

#region 免费发送飞们接口(2014-01-06 16:20测试有效)

/// <summary>

/// 免费发送飞们接口(要开通飞信把对方加为好友才能发,也可以给自己发做测试)

/// </summary>

/// <param name="sendNumber">登陆飞信手机号</param>

/// <param name="sendPassword">登陆密码</param>

/// <param name="receiveNumber">接收手机</param>

/// <param name="Content">短信内容</param>

/// <returns></returns>

public bool sendfetion(string sendNumber, string sendPassword, string receiveNumber, string Content)

{

string url = string.Format("https://quanapi.sinaapp.com/fetion.php?u={0}&p={1}&to={2}&m={3}", sendNumber, sendPassword, receiveNumber, HttpUtility.UrlEncode(Content));

string strRet = "";

try

{

HttpWebRequest hr = (HttpWebRequest)WebRequest.Create(url);

hr.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)";

hr.Method = "GET";

hr.Timeout = 30 * 60 * 1000;

WebResponse hs = hr.GetResponse();

Stream sr = hs.GetResponseStream();

StreamReader ser = new StreamReader(sr, Encoding.Default);

strRet = ser.ReadToEnd();

}

catch (Exception er)

{

strRet = "";

}

if (!strRet.Contains(":0")) return false;//成功时返回数据:{"result":0,"message":"\u53d1\u9001\u6210\u529f"}

return true;

}

#endregion

接口是搭建在SinaAppEngine上的,SAE的服务还算是比较牢靠的。

发送者用户、密码不要写错,然后接收者必须是自己或者飞信好友,才能发送成功。

您可能感兴趣的文章:

  • 通过第三方接口发送短信验证码/短信通知(推荐)
  • NodeJS实现阿里大鱼短信通知发送
  • ASP.NET(VB)写的后台发送短信实现代码
  • 阿里大鱼简单发送短信功能.net core版
  • C#代码实现短信验证码接口示例
  • C#怎么实现手机短信发送功能
  • java、php、C#、asp实现短信群发功能的方法
  • CDMA 猫用AT命令发中文短信(C#)
  • ASP.NET MVC阿里大于短信接口开发短信群发能

本文由 华域联盟 原创撰写:华域联盟 » asp.net调用飞信免费发短信(测试有效)

转载请保留出处和原文链接:https://www.cnhackhy.com/54452.htm

本文来自网络,不代表华域联盟立场,转载请注明出处。

作者: sterben

发表回复

联系我们

联系我们

2551209778

在线咨询: QQ交谈

邮箱: [email protected]

工作时间:周一至周五,9:00-17:30,节假日休息

关注微信
微信扫一扫关注我们

微信扫一扫关注我们

关注微博
返回顶部