T
tshad
I always see people closing a streamwriter as:
if (sw != null)
sw.Close().
But if you do an sw.Close() it doesn't set the value of sw to null.
I ran into an issue where I was writing to a streamwriter that was not open
and got an error as expected.
But how do you check if a streamwriter is open if you can't check for null?
Thanks,
Tom
if (sw != null)
sw.Close().
But if you do an sw.Close() it doesn't set the value of sw to null.
I ran into an issue where I was writing to a streamwriter that was not open
and got an error as expected.
But how do you check if a streamwriter is open if you can't check for null?
Thanks,
Tom