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
1,530
questions
1
vote
1
answer
277
views
NET6.0 FTP server networking issue on Docker container
I’m developing a NET 6.0 FTP server as part of a functionality to load the firmware of a hardware device. I need to have it inside a Docker container but I’m unable to make it work on that environment ...
2
votes
1
answer
1k
views
C# Process.StandardInput.Write deadlocks/hangs when not using StreamWriter.Close
I have a C# program that wants to interact with an external process written in C++. I believe this C++ process is using correct standard input. I just can't seem to get my C# code to not hang when ...
-1
votes
1
answer
55
views
How can I be %100 sure that writing to a text file has been finished in C#, so that I can proceed with another operation?
In my C# project, i have to write some info to a file with streamwriter, and afterwards I want to call a method. But I have to be % 100 sure that the writing process has been finished, otherwise a ...
1
vote
0
answers
62
views
Problem with sending and receiving in streams C# in textbox Windows Forms app
I managed to create a client server that communicate through forms.
I am able to display fist waiting and accepted messages.
My problem is when I'm writing to the stream and reading it on the other ...
0
votes
1
answer
235
views
Writing files in VB.Net - Permissions
I have a folder that I only want Administrators having permissions to write text files to it.
I need to write text files in a program and insert it into the folder. I am currently using StreamWriter ...
-1
votes
1
answer
150
views
StreamWriter is not adding empty cells correctly
I have a C# program that is supposed to generate an output that looks like this:
However, my output currently looks like this:
This is what my code looks like at the moment:
System.Text.Encoding....
1
vote
1
answer
314
views
IOException: The process cannot access the file 'fileName/textFile.txt' because it is being used by another process
I saw other threads about this problem, and non of them seems to solve my exact problem.
static void RecordUpdater(string username,int points,string term) //Updates Record File with New Records.
...
0
votes
1
answer
84
views
How to write into a file with StreamWriter in c#?
I can't write into a file correctly. The program reads the file and displays it on console with no problem, but I have some issues trying to write into this file.
I have this method:
public static ...
1
vote
0
answers
267
views
Special characters getting added while reading data from csv in C#
I am writing data in CSV and reading the line from CSV in C#.
When I am writing data -
using StreamWriter streamWriter = new StreamWriter(outputFilePath);
using var csv = new CsvWriter(streamWriter, ...
0
votes
1
answer
86
views
The FormClosing event seems to run after a different Form is started
I did a lot of research about this problem and tried methods but none of them worked. First I will show you what is in my application and what I want it to be with some pictures.
Picture 1
As you can ...
0
votes
2
answers
129
views
Write to file help c#
I am taking data from a file and counting the Status Codes and writing it to a file. When I run the program it does separate the StatusCode from the other numbers and in the output in visual studio ...
0
votes
0
answers
195
views
StreamWriter along with XmlSerializer in DotNet6 does not write WhiteSpaces?
Actually I tried this basic code in C# which serializes the DataSet into XML document.
static void Main(string[] args)
{
XmlSerializer ser = new XmlSerializer(typeof(DataSet));
// Creates a ...
1
vote
1
answer
251
views
How to Ignore lines with StreamWriter WriteLine
trying to figure out how to ignore or stop specific lines from being written to file with StreamWriter. Here is the code I'm working with from How to pass arguments to program when using variable as ...
0
votes
1
answer
209
views
C# problem automatically converting tab char to space
I'm experiencing a problem where tab char seems to be automatically converted to a space randomly.
char Delimiter = '\t'; // \t is tab
string headers = $"Column1{Delimiter}Column2{Delimiter}...
0
votes
2
answers
95
views
Multiple instances of StreamWriter working on multiple different disk files in multiple different tasks. Could I run into threading problems?
I have a C# application that creates multiple tasks (class System.Threading.Tasks.Task).
Each of these tasks writes to a file, each one writes to a different file from the others, using a different ...