C Sharp (C#)

To send SMS using C #, you must include the following classes  in your project:

using System.Net;
using System.Web;
using System.Text;
using System.IO;

string smsURL = "http://aspsmsapi.com/http/sendsms.aspx";
string username = "233xxxxxx"; // Your username
string apikey = "xxxxxx"; // ApiKey
string recipient = "233xxxxxx,233xxxxxx,233xxxxxx"; // MSIDSN (Number of the recipient in the International format)
string senderid = "ASPSMS"; // Sender ID
string msg = "Test Message C-SHARP"; // Message content
StreamWriter curlURL = null;
StringBuilder smsData = new StringBuilder();

smsData.Append("username=" + HttpUtility.UrlEncode(username) + "&");
smsData.Append("apikey=" + HttpUtility.UrlEncode(apikey) + "&");
smsData.Append("dest=" + HttpUtility.UrlEncode(recipient) + "&");
smsData.Append("senderid=" + HttpUtility.UrlEncode(senderid) + "&");
smsData.Append("msg=" + HttpUtility.UrlEncode(msg) + "&");
smsData.Append("authmode=http");

HttpWebRequest request = (HttpWebRequest)WebRequest.Create(smsURL);
request.Method = WebRequestMethods.Http.Post;
request.KeepAlive = false;
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = smsData.Length;

try
{
curlURL = new StreamWriter(request.GetRequestStream());
curlURL.Write(smsData.ToString());
}
finally
{
if (curlURL != null)
curlURL.Close();
}
The new disc fly replica watches collection series ladies watch incorporates many replica watch modern and fashionable aesthetic elements in the classic design. Available in 39mm and 36mm sizes, the watch is fake replica watches available in a variety of materials with replica rolex a rich palette of colours.