Top "Streamwriter" questions

StreamWriter is designed for character output in a particular encoding, whereas classes derived from Stream are designed for byte input and output.

Redirect .NET StreamWriter output to a String variable

I'd like to know if it is possible to redirect StreamWriter output to a variable Something like String^ myString; StreamWriter …

.net streamwriter
c# replace string within file

String.Replace doesn't seem to work properly when replacing a portion of an HTML file's content. For example, String.Replace …

c# file-io streamwriter fileinfo
Add a new line at a specific position in a text file.

I am trying to add a specific line of text in a file. Specifically between two boundaries. An example of …

c# io streamwriter
Write Unicode String In a File Using StreamWriter doesn't Work

I have this code: string s = "آ"; StreamWriter writer = new StreamWriter("a.txt", false, Encoding.UTF8); writer.WriteLine(s); but when …

c# .net stream streamwriter
Write Text In A Already Existing Text File VB.NET

I've been developing a arcade game, and as every good arcade game, it has an incorporated scoreboard so that players …

vb.net text lines streamwriter
DataGridView to CSV File

I have a VB 2010 Express Project, that has a DataGridView in it, that I am trying to write to a …

vb.net csv datagridview streamwriter
How to write to a file in Unicode in Vb.Net

How should I modify the following Vb.Net code to write str to the file in unicode? Do I need …

vb.net unicode streamwriter
StreamWriter replace line with a new text

Is it possible to replace the text in a text file with a new text without erasing the other data, …

c# windows forms streamwriter
StringBuilder.ToString() throws OutOfMemoryException

I have a created a StringBuilder of length "132370292", when I try to get the string using the ToString() method it …

c# .net-2.0 tostring stringbuilder streamwriter
Do I need to do StreamWriter.flush()?

Suppose this C# code: using (MemoryStream stream = new MemoryStream()) { StreamWriter normalWriter = new StreamWriter(stream); BinaryWriter binaryWriter = new BinaryWriter(stream); foreach(...) { …

c# flush memorystream streamwriter