Tuesday, 26 February 2013
Wednesday, 20 February 2013
Send SMS To Mobile using way2sms account in asp.net application
public void sendSMS(string uid, string password, string message, string no)
{
HttpWebRequest myReq =
HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create("http://moneycentral.msn.com/investor/StockRating/srstopstocksresults.aspx?sco=1&page=1col=13" + uid + "&pwd=" + password + "&msg=" + message + "&phone=" + no + "&provider=way2sms");
HttpWebResponse myResp = (HttpWebResponse)myReq.GetResponse();
System.IO.StreamReader respStreamReader = new System.IO.StreamReader(myResp.GetResponseStream());
string responseString = respStreamReader.ReadToEnd();
respStreamReader.Close();
myResp.Close();
}
protected void Button1_Click(object sender, EventArgs e)
{
try
{
if (TextBox1.Text != String.Empty && TextBox2.Text != String.Empty)
{
sendSMS("yourmobileno", "yourpassword", TextBox2.Text, TextBox1.Text);
TextBox1.Text = String.Empty;
TextBox2.Text = String.Empty;
Label3.Visible = true;
Label3.Text = "Message Sented";
}
else
{
Label3.Visible = true;
Label3.Text = "Not Sented";
}
}
catch (Exception)
{
throw;
}
}
{
HttpWebRequest myReq =
HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create("http://moneycentral.msn.com/investor/StockRating/srstopstocksresults.aspx?sco=1&page=1col=13" + uid + "&pwd=" + password + "&msg=" + message + "&phone=" + no + "&provider=way2sms");
HttpWebResponse myResp = (HttpWebResponse)myReq.GetResponse();
System.IO.StreamReader respStreamReader = new System.IO.StreamReader(myResp.GetResponseStream());
string responseString = respStreamReader.ReadToEnd();
respStreamReader.Close();
myResp.Close();
}
protected void Button1_Click(object sender, EventArgs e)
{
try
{
if (TextBox1.Text != String.Empty && TextBox2.Text != String.Empty)
{
sendSMS("yourmobileno", "yourpassword", TextBox2.Text, TextBox1.Text);
TextBox1.Text = String.Empty;
TextBox2.Text = String.Empty;
Label3.Visible = true;
Label3.Text = "Message Sented";
}
else
{
Label3.Visible = true;
Label3.Text = "Not Sented";
}
}
catch (Exception)
{
throw;
}
}
Subscribe to:
Posts (Atom)