473,406 Members | 2,705 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

HttpRepsone.OutputStream & HttpWebResponse.GetResponseStream()

Joe
The example in the msdn shows how to write an image to the OutputStream and
the example for GetResponseStream() shows how to read the stream and write
it to the console. Unfortunately there is no example on how to distinguish
between the image that was written to the stream and the page itself which
is being returned.

Is there a trick getting only that data I want from the stream or do I need
to add a delimiter and parse the entire response?

Thanks,
Joe
Dec 14 '06 #1
2 3971
its the same data. GetResponseStream, just lets you read what was
written to the output stream, which is what is rendered.

if you want just some of the data, then yes you need to parse it.

-- bruce (sqlwork.com)
Joe wrote:
The example in the msdn shows how to write an image to the OutputStream and
the example for GetResponseStream() shows how to read the stream and write
it to the console. Unfortunately there is no example on how to distinguish
between the image that was written to the stream and the page itself which
is being returned.

Is there a trick getting only that data I want from the stream or do I need
to add a delimiter and parse the entire response?

Thanks,
Joe

Dec 14 '06 #2
Hello Joe,

As for the "how to distinguish between the image that was written to the
stream and the page itself which is being returned."

do you mean you are using httpwebrequest to get the response content of a
page, and this page has has html content and contains some images on it,
and you want to know how to get image's binary content of the the whole
page's response content?

If this is the case, I think it is no supported to get both the contained
images(<imgelements)'s binary data and the page's html content in a
single request(webrequest call). This is because html page which contains
images (<imgelements) only contains a link to the actual resource, but do
not contains the actual image binary data in the html page's content. It is
the client webbrowser who download the actual image data through the
link(url) and present it on page UI. Therefore, when you use HttpWebrequest
to retrieve web page's response, you can get string based html content
only. If you want to get image data also, you need to send additional
requests through httpWebRequest based on image's urls.
Hope this helps. If there is anything else you wonder, please feel free to
let me know.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

This posting is provided "AS IS" with no warranties, and confers no rights.

Dec 14 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: hlabbott | last post by:
Hi I'm having a problem displaying attachments correctly. I have messages with attachments stored on Exchange2000 and want to be able to click a hyperlink in my project like in OWA and see an...
2
by: Mark Rae | last post by:
Hi, Can anyone please tell me if it's possible to use HttpWebRequest and HttpWebResponse in a class in a Windows application? I've tried referencing System and System.Web but there's still...
13
by: Jason Manfield | last post by:
For some URLs (e.g.http://v3.espacenet.com/origdoc?DB=EPODOC&IDX=WO2005028634&F=0&QPN=WO2005028634), the content length for the HttpWebResponse I get with request.GetResponse in empty. The...
3
by: Jenny | last post by:
Hi all, I'm using a second page to write dynamical generated images into the outputstream. This avoids using tmp-files on disc. My code-behind in the start aspx file is: 'Use second file to...
2
by: Brent | last post by:
I'm having odd problems with the HttpWebResponse class. Some servers are quite speedy, while others don't seem to want to talk to my code. Consider the following pages*: ...
16
by: Cheung, Jeffrey Jing-Yen | last post by:
I have a windows form application that generates a request, downloads an image, and waits the user to enter in login info. Unfortunately, this image is dynamic and based on session data. I have...
15
by: Snedker | last post by:
I'm using (HttpWebRequest and HttpWebResponse to check for updates. But how do I determine the size of the file before download? What I have in mind is a status text like "You have downloaded...
2
by: STEVE.KING | last post by:
Greetings: I need to download an executable and some other binary files (a C++ DLL) from a virtual directory in my WinForms application. No-Touch Deployment manages my .NET code fine but...
4
by: Hexman | last post by:
Code below ---- I've asked a similar question on this forum earlier. This is a slightly different situation. Previous Question ---- I'm trying to save some specific web pages to disk as...
2
by: Joe | last post by:
The example in the msdn shows how to write an image to the OutputStream and the example for GetResponseStream() shows how to read the stream and write it to the console. Unfortunately there is no...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.