private void button1_Click(object sender, EventArgs e)
{
object functionReturnValue = null;
using (System.Net.WebClient client = new System.Net.WebClient())
{
System.Collections.Specialized.NameValueCollection parameter = new System.Collections.Specialized.NameValueCollection();
string url = "https://www.itexmo.com/php_api/api.php";
conn.Open();
cmd = new SqlCommand("select FirstYear from Numbers", conn);
dr = cmd.ExecuteReader();
parameter.Add("1", "09123456789");
parameter.Add("2", richTextBox1.Text);
parameter.Add("3", "TR-CCDIS629375_B9R26");
parameter.Add("passwd", "u$454g4gi&w&");
dynamic rpb = client.UploadValues(url, "POST", parameter);
functionReturnValue = (new System.Text.UTF8Encoding()).GetString(rpb);
MessageBox.Show("Message has been sent!.", "Message", MessageBoxButtons.OK);
dr.Close();
conn.Close();
}
}
This code here is a normal code to send sms using an API to a single number, I only added the SqlCommand
to it and I know what to do about it, how am I going to get the multiple numbers from my database which I want to access using a comboBox? As you can see in my cmd SqlCommand
I'm trying to retrieve the data but I don't know to how to convert into a parameter to replace the single number in the parameter and send sms to multiple numbers. I am new to C#, any help is much appreciated.