public string sendmessage(int id) { try { string CN = ConfigurationManager.ConnectionStrings["DBMS"].ConnectionString; using (MySqlConnection cn = new MySqlConnection(CN)) { cn.Open(); string checkstatus = "Select * From SuperAgentMaster Where SuperagentID = '" + id + "'"; MySqlCommand cmd1 = new MySqlCommand(checkstatus, cn); MySqlDataAdapter adp = new MySqlDataAdapter(cmd1); DataTable dt = new DataTable(); adp.Fill(dt); string ContactNo = (dt.Rows[0]["ContactNo"]).ToString(); string Username = dt.Rows[0]["Code"].ToString(); string Password = dt.Rows[0]["Password"].ToString(); string Message = "This Is Your Username " + Username + " And " + Password + " \nFrom Sarkar50. club"; sendSMS smsSender = new sendSMS(); return(smsSender.SendSMS(ContactNo, Message)); } } catch (Exception e) { return(e.Message); } }
public void sendText() { sendSMS smssender = new sendSMS(); smssender.Send("+13522404231"); Debug.Log("sent text!"); }
static void Main(string[] args) { sendData Data = new sendEmail(); Data._bridgeComponents = new webService(); Data.send(); Data._bridgeComponents = new ThirdPartyUI(); Data.send(); sendData Data1 = new sendSMS(); Data1._bridgeComponents = new webService(); Data1.send(); //sendData Data = new sendEmail(); //sendData Data1 = new sendSMS(); Data1._bridgeComponents = new ThirdPartyUI(); Data1.send(); }
private void btnSave_Click(object sender, EventArgs e) { frmConnection con = new frmConnection(); con.ShowDialog(); con.GetPort(); //frmDemo demo = new frmDemo(); //demo.ShowDialog(); sendSMS sndsms = new sendSMS(); FineRecorddb db = new FineRecorddb(); string contact = db.GetGContact(txtRollNo.Text); string[] com = { "COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8" }; //MessageBox.Show(contact); string comNum = "0"; //contact = "+923336374591"; for (int i = 0; i < 8; i++) { if (sndsms.SetCOMNum(com[i])) { comNum = com[i]; } } if (contact != "0") { string msg = "Fine Amount:" + txtFineAmount.Text; msg += "\nFine Detail:" + txtDetail; sndsms.SetCOMNum(comNum); sndsms.Sendsms(msg, contact); } else { MessageBox.Show("Error No Guardian Contact number or invalid!"); } }
protected void btnsend_Click(object sender, EventArgs e) { string ContactNowithCommaSeperate = ""; if (CheckBox1.Checked == true) { string SuperagentContactNowithCommaSeperate = ""; string CN = ConfigurationManager.ConnectionStrings["DBMS"].ConnectionString; using (MySqlConnection cn = new MySqlConnection(CN)) { cn.Open(); string selectsuperagent = "Select ContactNo From SuperagentMaster where Status = 'Active'"; MySqlCommand selectsuperagentcmd = new MySqlCommand(selectsuperagent, cn); MySqlDataAdapter selectsuperagentadp = new MySqlDataAdapter(selectsuperagentcmd); DataTable selectsuperagentdt = new DataTable(); selectsuperagentadp.Fill(selectsuperagentdt); for (int i = 0; i < selectsuperagentdt.Rows.Count; i++) { string Contactno = selectsuperagentdt.Rows[i]["ContactNo"].ToString(); SuperagentContactNowithCommaSeperate = SuperagentContactNowithCommaSeperate + Contactno + ","; } } ContactNowithCommaSeperate = ContactNowithCommaSeperate + SuperagentContactNowithCommaSeperate; } if (CheckBox2.Checked == true) { string SuperagentContactNowithCommaSeperate = ""; string CN = ConfigurationManager.ConnectionStrings["DBMS"].ConnectionString; using (MySqlConnection cn = new MySqlConnection(CN)) { cn.Open(); string selectsuperagent = "Select ContactNo From agentMaster where Status = 'Active'"; MySqlCommand selectsuperagentcmd = new MySqlCommand(selectsuperagent, cn); MySqlDataAdapter selectsuperagentadp = new MySqlDataAdapter(selectsuperagentcmd); DataTable selectsuperagentdt = new DataTable(); selectsuperagentadp.Fill(selectsuperagentdt); for (int i = 0; i < selectsuperagentdt.Rows.Count; i++) { string Contactno = selectsuperagentdt.Rows[i]["ContactNo"].ToString(); SuperagentContactNowithCommaSeperate = SuperagentContactNowithCommaSeperate + Contactno + ","; } } ContactNowithCommaSeperate = ContactNowithCommaSeperate + SuperagentContactNowithCommaSeperate; } if (CheckBox3.Checked == true) { string SuperagentContactNowithCommaSeperate = ""; string CN = ConfigurationManager.ConnectionStrings["DBMS"].ConnectionString; using (MySqlConnection cn = new MySqlConnection(CN)) { cn.Open(); string selectsuperagent = "Select Contact_No From ClientMaster where Status = 'Active'"; MySqlCommand selectsuperagentcmd = new MySqlCommand(selectsuperagent, cn); MySqlDataAdapter selectsuperagentadp = new MySqlDataAdapter(selectsuperagentcmd); DataTable selectsuperagentdt = new DataTable(); selectsuperagentadp.Fill(selectsuperagentdt); for (int i = 0; i < selectsuperagentdt.Rows.Count; i++) { string Contactno = selectsuperagentdt.Rows[i]["Contact_No"].ToString(); SuperagentContactNowithCommaSeperate = SuperagentContactNowithCommaSeperate + Contactno + ","; } } ContactNowithCommaSeperate = ContactNowithCommaSeperate + SuperagentContactNowithCommaSeperate; } string message = "Match Sechduled \n " + txtdescription.Text + " \n\nFrom Sarkar50.com"; sendSMS smsSender = new sendSMS(); smsSender.SendSMS(ContactNowithCommaSeperate, message); txtdescription.Text = ""; ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "alert('Sent Message SuccessFully.....');", true); }
public void press() { cl = 0; sv = comboBox1.Text; sendTo = textBox3.Text; for (int i = 0; i < sendTo.Length; i++) { if (sendTo[i] == ';'||sendTo[i]==',') { cl++; } } if(sendTo==" "){ cl=-1; } String[] bk = new String[cl + 1]; int ct; int m = 0; for (int i = 0; i < cl + 1; i++) { ct = 0; for (; ct != 10; m++) { bk[i] = bk[i] + sendTo[m]; ct++; } m = m + 2; } for (int l = 0; l < cl + 1; l++) { // MessageBox.Show(bk[l]+" "+ bk[l].Length); } //area for (int i = 0; i < cl + 1; i++) { sendTo = bk[i]; if (sendTo.Length != 10) { MessageBox.Show("This is invalid no"); continue; } messge = StringFromRichTextBox(richTextBox1); messge = messge + x; if (sv == "way2sms") { x++; sendSMS sc = new sendSMS(); TextReader tr = new StreamReader("phoneno.txt"); Id = tr.ReadLine(); pass = tr.ReadLine(); sc.send(Id, pass, messge, sendTo, sv); } else { x++; sendSMS sd = new sendSMS(); TextReader tr = new StreamReader("phoneno.txt"); tr.ReadLine(); tr.ReadLine(); Id = tr.ReadLine(); pass = tr.ReadLine(); sd.send(Id, pass, messge, sendTo, sv); } // GC.Collect(); // int milliseconds = 5000; // Thread.Sleep(milliseconds); // GC.Collect(); } }
public sendSMSResponse sendSMS(sendSMS request) { SendMessage(request.Body.serviceNumber, request.Body.message); return new sendSMSResponse { Body = new sendSMSResponseBody { } }; }