StreamWriter.Close()
just calls StreamWriter.Dispose()
under the bonnet, so they do exactly the same thing.
StreamWriter.Dispose()
does close the underlying stream.
Reflector is your friend for questions like this 🙂
More Related Contents:
- How do I calculate someone’s age based on a DateTime type birthday?
- Process.start: how to get the output?
- How to provide user name and password when connecting to a network share
- URL Encoding using C#
- Using RegEx to balance match parenthesis
- Cast List to List
- how to create an animated gif in .net
- Windows Forms Splash Screen – Show a form while loading main form
- ASP.NET use SqlConnection connect MySQL
- AppSettings get value from .config file
- Using Process.Start() to start a process as a different user from within a Windows Service
- How can a Label control display Japanese characters properly when the Font used doesn’t support this language?
- .NET – WindowStyle = hidden vs. CreateNoWindow = true?
- What is the best practice for “Copy Local” and with project references?
- Extending an enum via inheritance
- How do I automatically display all properties of a class and their values in a string? [duplicate]
- Invalid URI: The format of the URI could not be determined
- datetime to string with time zone
- What is C# analog of C++ std::pair?
- Thread safe collections in .NET
- When do you use extension methods, ext. methods vs. inheritance?
- Access to the path is denied when saving image
- Pair-wise iteration in C#, or sliding window enumerator
- Compilation Error: “The modifier ‘public’ is not valid for this item” while explicitly implementing the interface
- How do I programmatically save an image from a URL?
- smtpclient ” failure sending mail”
- How do I prevent print screen
- Creating an empty file in C#
- What is the use case for the (C# 7.2) “private protected” modifier?
- Method Overloading with different return type [duplicate]