Top "Textwriter" questions

TextWriter is an abstract base within the .NET Framework, and represents a writer that can write a sequential series of characters.

Sharing violation IOException while reading and writing to file C#

Here is my code: public static TextWriter twLog = null; private int fileNo = 1; private string line = null; TextReader tr = new StreamReader("…

c# file-io textreader textwriter
Writing a Text File in memory and saving it with savefiledialog

I am trying to make a text file in memory, add some lines to it and at the end save …

c# memorystream savefiledialog textwriter
Cannot write to a closed TextWriter

I am trying to write text to my txt file. After the first write the application crash with error Cannot …

c# text-files textwriter
Why do I get System.Collections.Generic.Dictionary`2 when writing to a StreamWriter?

I have this code: Console.Title = "System Reader"; Console.WriteLine("Enter the Domain-Address <or local>:"); string domain = Console.…

c# dictionary streamwriter textwriter
Efficient way to write a lot of lines to a text file

I started off doing something as follows: using (TextWriter textWriter = new StreamWriter(filePath, append)) { foreach (MyClassA myClassA in myClassAs) { textWriter.…

c# .net textwriter
How to write console output to a text file

I have this key generating algorithm made in C that will display all generated keys in console: So how can …

c textwriter key-generator
Writing Unix style text file in C#

I'm trying to write a text file with Unix-style newlines with my C# program. For some reason the following code …

c# newline textwriter
Implementing a Derived Class of TextWriter

I have two classes, none of which I can change in any way: Class 1: Takes a TextWriter as constructor parameter …

c# textwriter
Redirecting a Stream to a Text Box in real-time

I have got an interesting dilemma where my application can run as a Console App or a Windows Forms App. …

c# winforms console textreader textwriter
Setting the color for Console.Error writes

I’m writing a console application that has a custom logger in it. The logger needs to color anything sent …

c# console-application textwriter