Skip to main content

Questions tagged [streamwriter]

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

streamwriter
0 votes
0 answers
23 views

Preserving basic application functions when using StandardInput/Output redirection

I’m trying to run an external (non-GUI) application and use RedirectStandardInput and RedirectStandardOutput to send data to and receive data from this application to a TextBox. The main problem is ...
Eric van Loon's user avatar
0 votes
0 answers
88 views

stop streamwriter writer and convert to string

i want to pull git log with cmd panel. this is relatively easy to do with Process process = new Process(); ProcessStartInfo info = new ProcessStartInfo(); info.FileName = "cmd.exe"; info....
Rene Krause's user avatar
0 votes
2 answers
652 views

Is it correct to leverage a stream writer WriteLineAsync with WhenAll

I have a snippet of code that is writing to a memory stream in an asynchronous way (.NET Standard 2.1) Create a list of hot tasks, one per a line Then await when all of them will be finished Flush ...
AllmanTool's user avatar
  • 1,494
-2 votes
1 answer
38 views

how do I make a text file line into a list

is it possible to make this into a list and then make a code where I can delete what's inside the list per line (text file) and then searching the contents of the list class data { public ...
Jay Delos Santos's user avatar
0 votes
0 answers
310 views

Asyncio stream writer persists data

I'm using asyncio to create a websocket between my clients and server. I am using StreamWriter.write() to send data to and from the client. data = { "type": "DRAW_RECT",...
jaal kamza's user avatar
1 vote
2 answers
369 views

Improve saving to CSV file (C#)

I'm writing column data to CSV file: string sep = CultureInfo.CurrentCulture.TextInfo.ListSeparator; string csvFile = "MyName.csv"; using (StreamWriter writer = new StreamWriter(csvFile)) { ...
4est's user avatar
  • 3,118
1 vote
3 answers
431 views

C# Reuse StreamWriter or FileStream but change destination file

A little background... Everything I'm about to describe up to my implementation of the StreamWriter is business processes which I cannot change. Every month I pull around 200 different tables of data ...
TheFuzzyGiggler's user avatar
0 votes
0 answers
29 views

Writing an ItemArray that contains NULLS

I'm trying to write a datarow out to a text file with delimiters between each value and this works fine until the SQL Table has any NULLs in it. I can possibly just remove the NULL values from the ...
Colster's user avatar
  • 79
2 votes
2 answers
468 views

stream writer is not writing to JSON file in webapi

Im trying to write data in a JSON file using webapi but stream writer is not writing data to the file. JSON File : { "Students": [ { "id": 1, "name": "Ravi&...
Tanmay Pawar's user avatar
0 votes
1 answer
254 views

Is there a way to delete all lines of text from a .txt file using StreamReader/Writer?

I am using C# with Unity. I have a text file in my assets that is updated by a void function via StreamWriter. I want to remove all lines of text from the file (making it blank) upon the execution of ...
DatBubby's user avatar
1 vote
1 answer
171 views

Save and load a game by using StreamWriter and ReadWriter (C#)

I'm creating a small program which can save and load char array values. Then, I got stuck with two problems. I have no idea how to make the program end after saving the data. After loading the char ...
gon's user avatar
  • 25
1 vote
1 answer
49 views

C# Wrap Array of StreamWriters in an using block (Or any smarter way)

I'm Writing to 2 files at a time from a row in a csv, basically I have a list of rows that some have errors so I want to create a log file with detailed errors per row and a new csv with all these ...
big boy's user avatar
  • 385
0 votes
0 answers
132 views

How to check stream writer flush called or not?

I have 2 places where I am calling writer.Flush() method like: StreamWriter writer; .... writer.Flush(); How to check was writer.Flush() called or not? there is my code: var writer = new ...
Dmytro Kryvoruchenko's user avatar
0 votes
1 answer
269 views

C#: System.ObjectDisposedException: 'Cannot write to a closed TextWriter.' [closed]

I'm writing a program that exports data from a DataTable into a csv file but when I run the program I get the error : System.ObjectDisposedException: 'Cannot write to a closed TextWriter.' Here's the ...
Zyko's user avatar
  • 3
0 votes
0 answers
30 views

TextWriter data missing but not throw exception

I have some codes process data like: select data from database write data to TXT file update data flag in database In little accident case, the data only write partly to the file, but data flag had ...
Jun Yu's user avatar
  • 415

15 30 50 per page