Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by mirzapirza

  1. mirzapirza

    Stream.Read sometimes returns -1, what to do?

    Uhm, Stream.Write that is.. ;)
  2. mirzapirza

    Stream.Read sometimes returns -1, what to do?

    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...
  3. mirzapirza

    Stream.Read sometimes returns -1, what to do?

    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]...
  4. mirzapirza

    Request.UrlReferrer error

    You should check if Request.UrlReferrer is null.. http://mirzapirza.com/
  5. mirzapirza

    Where can I learn about available namespaces?

    You could look in MSDN: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/cpref_start.asp http://mirzapirza.com/
  6. mirzapirza

    DateTime.Now: subtract 1 day from it

    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 =...
  7. mirzapirza

    Enter behavior..?

    I suggest you ask in the Javascript forum instead.
  8. mirzapirza

    LoadControl method

    Maybe if your class inherits from a page you could do something like: this.LoadControl(path);
  9. mirzapirza

    HTML File Object

    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 ;)
  10. mirzapirza

    Making a folder....

    Yes it's possible.. Look at the Directory and DirectoryInfo classes in the System.IO namespace.
  11. mirzapirza

    What's Wrong With This?

    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...
  12. mirzapirza

    What's Wrong With This?

    It's if, not If. :) What's ff?

Part and Inventory Search

Back
Top