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.

Why does StreamWriter overwrite my file?

I'm using SteamWriter to write something to a text file, however its overwriting the old data with the new data. …

c# filestream streamwriter
What is the default buffer size for StreamWriter

For the public StreamWriter(Stream stream) constructor, MSDN says Initializes a new instance of the StreamWriter class for the specified …

.net streamwriter
How to send keys instead of characters to a process?

System.Diagnostics.Process exposes a StreamWriter named StandardInput, which accepts only characters as far as I know. But I need …

c# .net process keyboard streamwriter
What is the difference between calling Stream.Write and using a StreamWriter?

What is the difference between instantiating a Stream object, such as MemoryStream and calling the memoryStream.Write() method to write …

c# memorystream streamwriter
How to detect a Socket Disconnect in C#

I'm working on a client/server relationship that is meant to push data back and forth for an indeterminate amount …

c# sockets tcpclient streamwriter
Streamwriter is cutting off my last couple of lines sometimes in the middle of a line?

Here is my code. : FileStream fileStreamRead = new FileStream(pathAndFileName, FileMode.OpenOrCreate, FileAccess.Read, FileShare.None); FileStream fileStreamWrite = new FileStream(reProcessedFile, …

c# streamwriter
How to make a "Read only" file?

I'm using the C# StreamWritier class. Questions: How can I make a file read-only, so that no one can delete …

c# file file-permissions streamwriter
Getting the file size from StreamWriter

using (var writer = File.CreateText(fullFilePath)) { file.Write(fileContent); } Given the above code, can the file size be known from …

c# streamwriter
What is the fastest way to export dataGridView rows to Excel or into an SQL Server database

What is the fastest way to export DataGridView rows in the range of 460328 - 800328 to Excel or into an SQL …

c# datagridview streamwriter
Try/Finally block vs calling dispose?

Is there any difference between these two code samples and if not, why does using exist? StreamWriter writer; try { writer = …

c# try-catch dispose using streamwriter