C Sharp (C#)

Afin d'envoyer des SMS en utilisant C#, vous devez inclure dans votre projet les classes suivantes :

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

string smsURL = "http://aspsmsapi.com/http/sendsms.aspx";
string username = "228xxxxxx"; // Votre nom d'utilisateur
string apikey = "xxxxxx"; // Votre clé API
string recipient = "228xxxxxx,228xxxxxx,228xxxxxx"; // Destinataire au format international
string senderid = "ASPSMS"; // Sender ID
string msg = "Test Message C-SHARP"; // Message
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.