textWriter Use?

Smriti Bhawana

New member
Joined
Aug 19, 2022
Messages
1
Programming Experience
Beginner
What is meaning of below code line:

TextWriter textWriter = new StreamWriter(@System.Environment.GetEnvironmentVariable("OUTPUT_PATH"), true);
 
It's just creating a stream writer to a file where the name of the file is stored in an environment variable. The true means append to a file if it exists. A stream writer is just a kind of text writer. There is no stream writer magic happening there. It's just a matter of reading C#, and looking in the documentation.

 
You need to learn to use the tools available to you first, then ask about the stuff you cannot work out specifically. In VS, you can click any type or member in code and press F1 to go directly to the documentation for that type or member. You could and should have done that for every type and member in that code that you don't understand. You then could have asked us more specific questions if you still needed to. We're happy to help with stuff you can't work out but you should still try to work out what you can for yourself first.
 
Back
Top Bottom