Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Professionals
|
ASP.NET 3.5 Professionals If you are an experienced ASP.NET programmer, this is the forum for your 3.5 questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Professionals section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 19th, 2011, 03:15 AM
Authorized User
 
Join Date: Apr 2010
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Question 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 ...





Similar Threads
Thread Thread Starter Forum Replies Last Post
WebRequest/WebResponse form submit problem. HELP! MAtkins ASP.NET 1.0 and 1.1 Professional 2 December 23rd, 2010 12:28 AM
Error with Webrequest mike_remember ASP.NET 1.0 and 1.1 Professional 5 October 17th, 2006 08:01 AM
Returning a custom WebResponse to the browser DudeBori82 ASP.NET 2.0 Professional 5 September 28th, 2006 07:53 AM
Webresponse contenttype different from request mikehsu317 C# 6 September 27th, 2006 10:42 AM
Getting correct encoding from a webresponse Jonax VB.NET 0 December 21st, 2004 05:37 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.