Quantcast
Channel: .NET Framework Class Libraries forum
Viewing all articles
Browse latest Browse all 8156

StreamWriter Class Question: How do you know if the writer is open?

$
0
0

In the following c# example, is there a way to determine if the writer is open.  I want to know if the writer is open before I do something with it.

writer = new StreamWriter(File.OpenWrite(@"c:\output.txt"));

 Also when I am done with the writer, should I close() it, dispose() it or both?


-7

Viewing all articles
Browse latest Browse all 8156

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>