Re: StreamReader.close and StreamWriter.close



<Eran.Yasso@xxxxxxxxx> wrote:
In the MSDN the sample doesn't use the close() method. But I know that
in most languages you do need to use the close() method after reading
and writing to a file.

<snip>

does the "Using" replaces the needing for Close() method?

Yes. "using" is equivalent to a try/finally block which calls Dispose()
in the finally block.

--
Jon Skeet - <skeet@xxxxxxxxx>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
.



Relevant Pages

  • Re: ide-scsi cdrw mounts, cdrom works but no mount
    ... Based on that error, and that writing works OK, I guess that your ... but the reading bit is broken. ... separate lasers for reading and writing, ...
    (Debian-User)
  • Re: Problem with a script
    ... writing the code twice will only ... problem to less than 20 lines, people might've actually paid attention ... reading your entire code and parsing it in their head, ...
    (comp.lang.php)
  • Re: Terry Pratchett -EOS Alzheimers
    ... And you're not reading what I'm writing, That isn't what I've been saying ... reading some good science fiction, and it's not easy for people to be ...
    (uk.people.support.depression)
  • Re: Beginner Question - Resetting File Pointer
    ... > I am writing a simple program that checks to see if a ... > user-inputed string is contained in a certain text file. ... [SNIP] ... You might want to be sure to use an explicit encoding for reading the file. ...
    (comp.lang.java.help)