how to use webrequest and webresponse classes
I have created an applicatiion using a third part api for sending sms via web
here's the code i have used
string num = txtNo.Text;
string msg = txtMessage.Text;
string url = "http://smslane.com/vendorsms/pushsms.aspx?user=harsh&password=may240586&msisdn= " + num;
url += "&sid=WebSMS&msg="+msg;
url += "&fl=0";
Uri uri = new Uri(url);
WebRequest request = WebRequest.Create(uri);
WebResponse response = request.GetResponse();
//String ver = response.ResponseUri();
StreamReader reader = new StreamReader(response.GetResponseStream());
string str = reader.ReadLine();
while (str != null)
{
Response.Write(str);
str = reader.ReadLine();
LblError.Text = str;
on running this code i am getting a text message from that site as a response.
now what i want to do is i want save this message in a variable so that depending on the response message i receive , i want to have my own custom message in my website..
can u please help me with with it...
any help will be gratfull..
thanks in advance ...
|