i know that is a stupid question but i need know. - httpWebRequest

T

Taryon

private void button5_Click(object sender, System.EventArgs e)
{
HttpWebRequest request = (HttpWebRequest)WebRequest.Create
("http://192.168.0.2/card/default.aspx?card="+textBox1.Text);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
String ver = response.ProtocolVersion.ToString();
StreamReader reader = new StreamReader(response.GetResponseStream() );
string str = reader.ReadLine();
while(str != null)
{
Console.WriteLine(str);
str = reader.ReadLine();
string x=""; <-- i have a breakpoint here.

this is my routine to send the card number. my default.aspx page gets this
number and find the informations on the database.

the default.aspx page then i use the Response.Write(info); but i got the
line below.
i know that i am doing wrong but ....

"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" >"
 
J

Jon Skeet [C# MVP]

Taryon said:
private void button5_Click(object sender, System.EventArgs e)
{
HttpWebRequest request = (HttpWebRequest)WebRequest.Create
("http://192.168.0.2/card/default.aspx?card="+textBox1.Text);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
String ver = response.ProtocolVersion.ToString();
StreamReader reader = new StreamReader(response.GetResponseStream() );
string str = reader.ReadLine();
while(str != null)
{
Console.WriteLine(str);
str = reader.ReadLine();
string x=""; <-- i have a breakpoint here.

this is my routine to send the card number. my default.aspx page gets this
number and find the informations on the database.

the default.aspx page then i use the Response.Write(info); but i got the
line below.
i know that i am doing wrong but ....

"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" >"

What's wrong with that? My guess is that ASP.NET is adding a (perfectly
reasonable, by the looks of it) doctype declaration at the start of the
page. If you don't want it to be writing the response as an HTML page,
that's s different matter - but one best adderssed in the ASP.NET
group.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top