Click here to Skip to main content
15,905,616 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Web;
using System.Net;
using System.IO;

namespace WindowsFormsApplication3
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void btnSend_Click(object sender, EventArgs e)
        {
            send(txtLoginId.Text, txtpassword.Text, richTextBox1.Text, textBox1.Text);
        }
       
        public void send(string uid, string password, string message, string no)
        {
            try
            {
                HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create("http://ubaid.tk/sms/sms.aspx?=" + 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();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            MessageBox.Show("Msg Send");
        }
    }
}
Posted
Updated 26-Apr-13 1:07am
v3
Comments
Richard MacCutchan 26-Apr-13 7:04am    
"Doesn't work" is not a technical explanation. Please provide proper details of what happens including any error codes or messages.
Pheonyx 26-Apr-13 7:04am    
Use Improve Question to format your question, Code should be within the code block feature so it formats it clearly.
And in addition, actually make it a question. What problems are you having? Are you getting an error? saying "it doesn't work" is very vague.

What debugging have you tried?
KM Perumal 26-Apr-13 7:14am    
is this Correct API for way2sms
Raavis 26-Apr-13 7:22am    
way2sms is blocking the IP of above site hence the way2sms has been removed from above site. :)
Raavis 26-Apr-13 7:14am    
there's problem in request. "siteurl.com?uid"+uid <<-- here user id has no querysting parameter.

C#
HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create("http://ubaid.tk/sms/sms.aspx?uid=" + 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();
 
Share this answer
 
try with
provider=site2SMS

because way2SMS is not available in above URL
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900