473,386 Members | 1,819 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,386 software developers and data experts.

How to find the length of a network stream which does not support

I have a network stream which I got from HttpWebResponse and does not support
seeking, How do I find the length of the network stream?

HttpWebResponse* response = dynamic_cast<HttpWebResponse*>
(request->GetResponse());

// Gets the stream associated with the response.
Stream* receiveStream = response->GetResponseStream();

int n = receiveStream->Read(responseArray, 0, responseString->Length);

----------------------------

not supported
Jul 21 '05 #1
2 3531
Sorry. Correct some typos.
-----------------------------------
I have a network stream which I got from HttpWebResponse and does not support
seeking, How do I find the length of the network stream?

HttpWebResponse* response = dynamic_cast<HttpWebResponse*>
(request->GetResponse());

// Gets the stream associated with the response.
Stream* receiveStream = response->GetResponseStream();

int n = receiveStream->Read(responseArray, 0, receiveStream->Length);

-----------------------------
not supported
Jul 21 '05 #2
Kueishiong Tu <Ku**********@discussions.microsoft.com> wrote:
Sorry. Correct some typos.
-----------------------------------
I have a network stream which I got from HttpWebResponse and does not support
seeking, How do I find the length of the network stream?

HttpWebResponse* response = dynamic_cast<HttpWebResponse*>
(request->GetResponse());

// Gets the stream associated with the response.
Stream* receiveStream = response->GetResponseStream();

int n = receiveStream->Read(responseArray, 0, receiveStream->Length);

-----------------------------
not supported


Well, you could use response.ContentLength - or you could just read the
whole stream (see http://www.pobox.com/~skeet/csharp/readbinary.html)
and then you'll know the length.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #3

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

Similar topics

4
by: Madestro | last post by:
Hi guys, I am making a small program to retrieve e-mails from POP accounts. I got all the e-mail parsing stuff figured out, but I cannot seem to come up with a way to find out which e-mails are...
31
by: RS | last post by:
Hi, Looking to see if the following construct is valid: typedef struct { int foo; char bar; } foobar; Basically, the idea is to have the structure above point to a message buffer that has...
7
by: simonrigby_uk | last post by:
Hi all, Sorry if this is the incorrect group but I couldn't see anything directly relevant. Can someone confirm for me what happens when two network streams are sent to an application at the...
2
by: Kueishiong Tu | last post by:
I have a network stream which I got from HttpWebResponse and does not support seeking, How do I find the length of the network stream? HttpWebResponse* response = dynamic_cast<HttpWebResponse*>...
3
by: Tim Marsden | last post by:
Hi, I would like to redirect my browser to a Network file (not on the Web Server), whrn a button is clicked. For example a Excel workbook. I would like options to open it in Excel, in the...
3
by: A.M-SG | last post by:
Hi, I have a ASP.NET aspx file that needs to pass large images from a network storage to client browser. The requirement is that users cannot have access to the network share. The aspx file...
2
by: Kueishiong Tu | last post by:
I have a network stream which I got from HttpWebResponse and does not support seeking, How do I find the length of the network stream? HttpWebResponse* response = dynamic_cast<HttpWebResponse*>...
22
by: semedao | last post by:
Hi , I am using asyc sockets p2p connection between 2 clients. when I debug step by step the both sides , i'ts work ok. when I run it , in somepoint (same location in the code) when I want to...
7
by: =?Utf-8?B?Um9iIFRob21zb24=?= | last post by:
Hi is there a way in asp.net 1.1 to in code behind query the page size that is generated, I realise IIS does it as it has that data in the logs, I would like to capture this data so that I can...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.