Steve <(E-Mail Removed)> wrote:
> I'm having problems downloading and saving files from the Internet.
> When I run the following code multiple times it grinds to a halt on CE4.1
> The first time I call it, it works ok, then it gets really slow, and if I
> leave it running it takes minutes to return.
> However the same exe running on the desktop is fine, and will download all
> files fine.
I don't know why you're having problems, but your reading code is
definitely flawed. You're reading to the start of your buffer every
time, rather than from the position you'd got to. Your call:
n=reader.Read(inBuf,0,262144*4);
should be
n=reader.Read(inBuf,bytesRead,bytesToRead);
--
Jon Skeet - <(E-Mail Removed)>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too