C# Development - Send SMS Message With Computer

Words
166
Reading
1 min
Listen
Play
9y

With this program you can send sms from your computer to your phone, your friends.

The vianett.com site is used for the sms codes of the program

Design of the program
Tasarım.png


Message TextBox and Form1 Properties

Ayarlar1.png
Ayarlar2.png


Code and website we will use for Sms
sms code.png


Right-click in the References area, select Add Reference, tick in the System.Web library, and click OK.
references.png


SMS Codes
kod ekranı.png


Result
Sonuç.png


https://github.com/ShanksTaicho/Send-SMS-message

Code list used in the project

 private void btnSend_Click(object sender, EventArgs e)
{
using (System.Net.WebClient client = new System.Net.WebClient())
{
try
{
string url = " http://smsc.vianett.no/v3/send.ashx?" +
"src=" + txtPhoneNumber.Text + "&" +
"dst=" + txtPhoneNumber.Text + "&" +
"msg=" + System.Web.HttpUtility.UrlEncode(txtMessage.Text, System.Text.Encoding.GetEncoding("ISO-8859-1")) + "&" +
"username=" + System.Web.HttpUtility.UrlEncode(txtUsername.Text) + "&" +
"password=" + System.Web.HttpUtility.UrlEncode(txtPassword.Text);
string result = client.DownloadString(url);
if (result.Contains("OK"))
MessageBox.Show("Your message has been succesfully sent.", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
else
MessageBox.Show("Message send failure.", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
   
}

catch(Exception ex)
{
MessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}



Posted on Utopian.io - Rewarding Open Source Contributors

C# Development - Send SMS Message With Computer | Ecency