obislavu, it does. Even when I use WebClient.DownloadFile I sometimes catch exceptions with an inner ArgumentException coming from the Stream.Read saying that the parameter 'count' can't be negative. :)
I was wondering how i should interpret this? Should I treat -1 like 0 and assume there's no...
It's not documented in the MSDN. The Read method is supposed to return the number of bytes read from the stream, or 0 if there's no more data.
Here's what I'm currently doing..
// reader is a Stream
using(reader = new WebClient().OpenRead(url))
{
int read = 1;
byte[] buff = new byte[4096]...
You'll have to specify what you want it to subtract. 1 could be anything. You want 1 day.. You could use the TimeSpan class to specify some amount of time. And one of the Subtract methods even takes a TimeSpan as a parameter.. Here's some code:
DateTime yesterday =...
Actually.. I don't think it's possible to assign anything to the text field of the file input element. That's probably why asp.net can't save it's viewstate.
If you could do that it would be very simple to get any file from the users harddrive ;)
Well actually, this works perfectly fine and I tend to use it a lot..
if(condition)
onlyOneStatement;
// no braces!
But some people would call it bad practice. (What if someone editing the code doesn't notice the lack of braces and adds another statement?)
Anyway, the if statement does...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.