Skip to main content

All Questions

0 votes
0 answers
20 views

NamedPipeClientStream stalls after the first ReadLineAsync, and stalls on the first WriteLineAsync

I chose NamedPipes over TCP because I needed two applications on the same machine to talk to each other. I wanted exceedingly simple, quick, and easy, unfortunately it has proven to be the opposite. ...
Zoop's user avatar
  • 1,015
3 votes
2 answers
253 views

C# StreamReader throws OutOfMemoryException on last line when splitting large delimited text file

I am writing a function in C# to split a large delimited file into smaller delimited files. I am writing this function because a 2.7 GB file was taking hours to ETL and was causing a bottleneck to ...
zBomb's user avatar
  • 361
0 votes
1 answer
127 views

How to access a relative URI using StreamReader in C#

So I'm trying to read/write to a generic .dat file which contains plain text. I've been trying to do it with StreamReader/Writer as this seemed to be the neatest way of doing things. The data.dat file ...
AuthorBrotherGames's user avatar
-3 votes
1 answer
1k views

C# "The process cannot access the file because it is being used by another process" error

I've been trying to figure out what's my error here for a few minutes now. can someone help? public void UpdateItemList(string word, string replacement) { StreamReader ...
tin's user avatar
  • 15
-1 votes
1 answer
40 views

no duplication of username does not work on my C# windows form, it only debugs the first array of my .txt file

Example .txt file output will be: lastname|firstname|tintin|password|Manager lastname|firstname|carley|password|Manager If I try to register username 'tintin' and other data, it debugs it and says ...
tin's user avatar
  • 15
0 votes
0 answers
43 views

How to detect and print the encoding of a list of .sql files in a particular directory?

I have a list of .sql files that need to checked for their encoding before i make changes to them. They are either in utf 8 or utf 16. How can I make some changes to my code so that it enter code ...
Vemala Valas's user avatar
2 votes
2 answers
302 views

My windows service in C# cannot write to file, when at the same time another C# app is trying to read the file

I have a Windows service in C# that is writing some data to a text file every 35ms. Normally everything was working fine. But recently I have programmed a simple windows forms app that is reading data ...
Mdarende's user avatar
  • 661
0 votes
0 answers
40 views

Should i close each substreams of filestream or closing filestream will be enought?

I readed a lot of topics about C# streams, but did not find my situation. For learing purpose i did list-file json-bd like: public sealed class JSONBD<T> : IDisposable { private FileStream ...
VladisS's user avatar
  • 67
1 vote
1 answer
46 views

How to store specific lines in a text file in a array (i.e 2 seperate bank accounts)

I am doing a ATM project for my computer science class and we are required to make an ATM that stores and reads accounts in a text file. I am stuck trying to figure out how I can get an array in the ...
Optik's user avatar
  • 11
0 votes
3 answers
107 views

How to overwrite a string in a text document

Doing a ATM Machine for my computer science project and I wanted to know how to overwrite a specific string of text in a text document. Ex: The program asks the user how much they want to deposit; ...
Optik's user avatar
  • 11
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
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
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
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

15 30 50 per page
1
2 3 4 5
19