public bool SendSMS1(string MobNo, string message) { string MSG = "0"; string MoNo = "0"; DataSet dsSMS = new DataSet(); BL_SmsCenter smsCenter = new BL_SmsCenter(); dsSMS = smsCenter.GetMasterSettingData(); if (dsSMS.Tables.Count > 0) { MSG = message; MoNo = MobNo; string URL = dsSMS.Tables[0].Rows[0]["SMSurl"].ToString(); string URL1 = URL.Replace("*", MoNo); string URL2 = URL1.Replace("$", MSG); try { HttpWebRequest request = WebRequest.Create(URL2) as HttpWebRequest; HttpWebResponse response = request.GetResponse() as HttpWebResponse; Stream stream = response.GetResponseStream(); //MessageBox.Show("Message Send Successfully."); return(true); } catch { return(false); } } return(true); }
public void SendSMS(string custonnumber, string message) { string MSG = "0"; string MoNo = "0"; DataSet dsSMS = new DataSet(); BL_SmsCenter smsCenter = new BL_SmsCenter(); dsSMS = smsCenter.GetMasterSettingData(); if (dsSMS.Tables.Count > 0) { MSG = message; MoNo = custonnumber; string URL = dsSMS.Tables[0].Rows[0]["SMSurl"].ToString(); string URL1 = URL.Replace("*", MoNo); string URL2 = URL1.Replace("$", MSG); try { HttpWebRequest request = WebRequest.Create(URL2) as HttpWebRequest; HttpWebResponse response = request.GetResponse() as HttpWebResponse; Stream stream = response.GetResponseStream(); } catch { } } }