C# Development - Send SMS Message With Computer

View this thread on: d.buzz | hive.blog | peakd.com | ecency.com
·@shankstaicho·
0.000 HBD
C# Development - Send SMS Message With Computer
> 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](https://res.cloudinary.com/hpiynhbhq/image/upload/v1514465567/xltavvihp8whx2yajtzr.png)
-----------------------------------------------------------------------------------------------------------------------------
> Message TextBox and Form1 Properties

![Ayarlar1.png](https://res.cloudinary.com/hpiynhbhq/image/upload/v1514465638/pnpp6yvjtuvqswzoycy0.png)
![Ayarlar2.png](https://res.cloudinary.com/hpiynhbhq/image/upload/v1514465645/s5znrpkj6y0z5sk36jqq.png)
-----------------------------------------------------------------------------------------------------------------------------
> Code and website we will use for Sms
![sms code.png](https://res.cloudinary.com/hpiynhbhq/image/upload/v1514465712/fbh1pocqroqtefk8k8ti.png)
-----------------------------------------------------------------------------------------------------------------------------
> Right-click in the References area, select Add Reference, tick in the System.Web library, and click OK.
![references.png](https://res.cloudinary.com/hpiynhbhq/image/upload/v1514465808/gcekdjtpf16sfet0e1ws.png)
-----------------------------------------------------------------------------------------------------------------------------
SMS Codes 
![kod ekranı.png](https://res.cloudinary.com/hpiynhbhq/image/upload/v1514465855/jvashasa4aqjvfzr8ry4.png)
-----------------------------------------------------------------------------------------------------------------------------
Result
![Sonuç.png](https://res.cloudinary.com/hpiynhbhq/image/upload/v1514465893/wnbug0jiftmvi3mahwq3.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);
    }
    }
    }

<br /><hr/><em>Posted on <a href="https://utopian.io/utopian-io/@shankstaicho/c-development-send-sms-message-with-computer">Utopian.io -  Rewarding Open Source Contributors</a></em><hr/>
👍 , , , , , ,