将短信发送到手机号码

将短信发送到手机号码

本文介绍了如何在选中复选框时将短信发送到手机号码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何通过选中复选框将短信发送到手机号码

how to send sms to mobile number on selecting the check box

推荐答案


using System.Text;
using System.IO;
using System.Net;
using System.Net.Sockets;




 string send_url = url;
                Uri uri = new Uri(send_url);
                string data = "field-keywords=ASP.NET 2.0";
                if (uri.Scheme == Uri.UriSchemeHttp)
                {
                    HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(uri);
                    request.Method = WebRequestMethods.Http.Post;
                    request.ContentLength = data.Length;
                    request.ContentType = "application/x-www-form-urlencoded";
                    StreamWriter writer = new StreamWriter(request.GetRequestStream());
                    writer.Write(data);
                    writer.Close();

                    HttpWebResponse response = (HttpWebResponse)request.GetResponse();
                    StreamReader reader = new StreamReader(response.GetResponseStream());
                    string tmp = reader.ReadToEnd();
                    response.Close();
                    conf_sent_sms = tmp.ToString(); 
                }



url ="www.asd.com?uid=abc&pss = *****& mobileno = 919236 ******& mess = ZZZZZZZZZZZZZZZZZZZZZZZZ";



url ="www.asd.com?uid=abc&pss=*****&mobileno=919236******& mess=ZZZZZZZZZZZZZZZZZZZZZZ";



这篇关于如何在选中复选框时将短信发送到手机号码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 20:21