Monday, June 27, 2011

SMS sending via Service Provider API in C#

This is the sample code which is use for sending SMS from window application in c#

using System.Net;
using System.IO;

 String strname = "http://isms.sapstech.com/pushsms.php?username=nishantvipul&password=12345&sender=VIPUL&to=9708094346,9263870334,94312350123&message=Hi%20This%20is%20a%20test%20message.&priority=2";
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(strname);

            HttpWebResponse response = (HttpWebResponse)request.GetResponse();

            StreamReader reader = new StreamReader(response.GetResponseStream());

            string result = reader.ReadToEnd();
            MessageBox.Show(result);

No comments:

Post a Comment