SMS gateway programming
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.IO;
string ozUser, ozPassw, sender, reciver, route1, sms1;
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
ozUser = "na";
ozPassw = "na";
sender = "na";
reciver = TextBox4.Text;
route1 = "TA";
Label1.Text = TextBox1.Text + "\n" + TextBox2.Text + "\n" + TextBox3.Text;
string URL = "http://url of api/httpapi/smsapi?uname=" + ozUser + "&password=" + ozPassw + "&sender=" + sender + "&receiver=" + reciver + "&route=" + route1 + "&msgtype=" + 1 + "&sms=" + Label1.Text;
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(URL);
request.Method = "GET";
request.ContentType = "application/json";
request.ContentLength = 0;// DATA.Length;
WebResponse webResponse = request.GetResponse();
Stream webStream = webResponse.GetResponseStream();
StreamReader responseReader = new StreamReader(webStream);
string response = responseReader.ReadToEnd();
Console.Out.WriteLine(response);
responseReader.Close();
}
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.IO;
string ozUser, ozPassw, sender, reciver, route1, sms1;
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
ozUser = "na";
ozPassw = "na";
sender = "na";
reciver = TextBox4.Text;
route1 = "TA";
Label1.Text = TextBox1.Text + "\n" + TextBox2.Text + "\n" + TextBox3.Text;
string URL = "http://url of api/httpapi/smsapi?uname=" + ozUser + "&password=" + ozPassw + "&sender=" + sender + "&receiver=" + reciver + "&route=" + route1 + "&msgtype=" + 1 + "&sms=" + Label1.Text;
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(URL);
request.Method = "GET";
request.ContentType = "application/json";
request.ContentLength = 0;// DATA.Length;
WebResponse webResponse = request.GetResponse();
Stream webStream = webResponse.GetResponseStream();
StreamReader responseReader = new StreamReader(webStream);
string response = responseReader.ReadToEnd();
Console.Out.WriteLine(response);
responseReader.Close();
}