Advertisement
Guest User

Untitled

a guest
Dec 29th, 2016
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. using (System.Net.WebClient client = new System.Net.WebClient())
  2. {
  3. try
  4. {
  5. String url = "http://smsc.vianett.no/v3/send.ashx?" +
  6. "src=" + phone.Text + "&" +
  7. "dst=" + phone.Text + "&" +
  8. "msg=" + System.Web.HttpUtility.UrlEncode(messagebody.Text,System.Text.Encoding.GetEncoding("ISO-8859-1")) + "&" + "username="+System.Web.HttpUtility.UrlEncode(username.Text) + "&" +
  9. "password="+System.Web.HttpUtility.UrlEncode(pass.Text);
  10. String result = client.DownloadString(url);
  11. if (result.Contains("OK"))
  12. {
  13. MessageBox.Show("message sended");
  14. }
  15. else
  16. {
  17. MessageBox.Show("message not sended");
  18. }
  19. }
  20. catch (Exception ex)
  21. {
  22. MessageBox.Show(ex.Message);
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement