短信接口示例
这篇文章主要为大家分享ASP.NET(C#)短信接口代码,ASP.NET(C#)短信发送、ASP.NET(C#)批量发送、ASP.NET(C#)短信验证码发送,感兴趣的小伙伴们可以参考一下。
string url = "https://www.suisms.net/sms.aspx"; string param = "action=send&userid=userid&account=account&password=password&mobile=mobile&content=content"; string result = request(url,param); ////// 发送HTTP请求 //////请求的URL///请求的参数///请求结果public static string request(string url, string param) { string strURL = url + '?' + param; System.Net.HttpWebRequest request; request = (System.Net.HttpWebRequest)WebRequest.Create(strURL); request.Method = "GET"; System.Net.HttpWebResponse response; response = (System.Net.HttpWebResponse)request.GetResponse(); System.IO.Stream s; s = response.GetResponseStream(); string StrDate = ""; string strValue = ""; StreamReader Reader = new StreamReader(s, Encoding.UTF8); while ((StrDate = Reader.ReadLine()) != null) { strValue += StrDate + " "; } return strValue; }