asp.net calls Fetion free SMS of test valid

  • 2020-12-20 03:32:52
  • OfStack

 
#region  Send fly interface for free (2014-01-06 16:20 The test effectively ) 
/// <summary> 
///  Free to send fly interface (to open the fee-letter to add each other as friends to send, can also send to their own test)  
/// </summary> 
/// <param name="sendNumber"> Land on the messenger phone </param> 
/// <param name="sendPassword"> password </param> 
/// <param name="receiveNumber"> Receive cell phone </param> 
/// <param name="Content"> Message 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;// Data returned on success: {"result":0,"message":"\u53d1\u9001\u6210\u529f"} 
return true; 
} 
#endregion 

The interface is built on SinaAppEngine, and SAE's services are relatively solid.
Sender user, password do not write wrong, and then the recipient must be himself or fetion friends, to send success.

Related articles: