HttpWebResponse getting attributes

  • Thread starter Thread starter Nuno Magalhaes
  • Start date Start date
N

Nuno Magalhaes

How can I get all the attributes of an HttpWebResponse? I do a request
to this site: http://pipa.inov.pt/cgi-bin/camera but originaly it comes
with a PAGE attribute that gives me the time in clock ticks of the
captured image like this:
http://pipa.inov.pt/cgi-bin/camera?PAGE=114349432

You can try it: http://pipa.inov.pt/ and it will give a URL like the
above with the PAGE attribute but my request "ends" on ".../camera".
How can I get the PAGE attribute... in the header? How can I do this?

Any lights will be appreciated,
Nuno Magalhaes.
 
Here's the sample code:
-------------------------------------------------------------
private Image GetImage(string sURL)
{
Stream stream=null;
//Prepare web request
HttpWebRequest wReq=(HttpWebRequest)WebRequest.Create(sURL);
//Get web response
HttpWebResponse wRes=(HttpWebResponse)wReq.GetResponse();
stream=wRes.GetResponseStream();
return Image.FromStream(stream);
}
-------------------------------------------------------------------

I want the property page so that I can calculate the frames per
seconds.

Thank you,
Nuno Magalhaes.
 
Hi,

A webresponse do not have any GET attributes, only the WebRequest have
them.

Most probably the page you get will have a link (which in turn may become
the next webrequest ) with the correct GET attributes.

cheers,
 
Thank you for your respose. By the way is it possible to select a new
host IP from a specific adapter and not using the default adapter? In
other words, how can I use WebRequest and WebResponse using a specific
IP from an adapter that is not the default adapter (and without messing
with low level sockets).
 
Another question by the way. Is it possible with WebRequest and
WebResponse to mount a server... in other words again, is it possible
to use an application as proxy using only the interfaces described
above (without going to sockets or we have to serialize the image and
send it by sockets)?

Thank you,
Nuno Magalhaes.
 
Hi,

Not sure, but I'm inclined to NO.

why you want to do that? routing is something done at lower level. you do
not have control over it from .net

cheers,
 
Back
Top