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
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 ...
Sergio Garrido's user avatar
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 ...
GhostRavenstorm's user avatar
-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 ...
Mdarende's user avatar
  • 661
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 ...
ektfaa's user avatar
  • 11
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 ...
Sbleezy's user avatar
  • 27
-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....
Ford Burgess's user avatar
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. ...
Bor1s's user avatar
  • 13
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 ...
bri's user avatar
  • 15
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, ...
Kavita Korgaonkar's user avatar
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 ...
emogo's user avatar
  • 45
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 ...
software_dev_1's user avatar
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 ...
Nandha's user avatar
  • 21
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 ...
user avatar
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}...
SendETHToThisAddress's user avatar
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 ...
dbman1980's user avatar

15 30 50 per page
1
3 4
5
6 7
102