if (txtMobile.Text == string.Empty) { MessageBox.Show("Enter Valid Mobile No"); } else { using (System.Net.WebClient client = new System.Net.WebClient()) { try { string url = "http://bulksms.abc.in/API/WebSMS/Http/v1.0a/index.php? " + "&username=" + System.Web.HttpUtility.UrlEncode(txtUserName.Text) + "&password=" + System.Web.HttpUtility.UrlEncode(txtPassword.Text) + "&sender=" + txtSenderID.Text + "&to=" + txtMobile.Text + "&message=" + System.Web.HttpUtility.UrlEncode(txtSmsContent.Text, System.Text.Encoding.GetEncoding("ISO-8859-1")); string result = client.DownloadString(url); if (result.Contains("OK")) MessageBox.Show("Your message has been successfully sent.", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information); else MessageBox.Show("Message Failed", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception exr) { MessageBox.Show(exr.Message, "Message", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)