Skip to main content

All Questions

Tagged with
0 votes
1 answer
69 views

How do I make the results from a dartsimulator in c# write to a txt file with streamwriter?

The Game is running correct but now I need/want to print the result from the game to a text file using streamwriter. How do I make that happen? To extract the info from the result? Been trying ...
Christopher Wahlström's user avatar
2 votes
3 answers
2k views

Why is writing to a file faster than appending a string?

Given that RAM is much faster than a hard drive, I was surprised by the code below. I was trying to split a CSV files based on the value of one column, and write each line with different values in ...
MikeS159's user avatar
  • 1,954
0 votes
1 answer
1k views

StreamWriter 64512 character limitation

I am using stringbuilder to collect some strings in my code. At the of that code my stringbuilder has more than 100000 chars. But writeline function writes only first 64512 chars in stringBuilder. ...
neverwinter's user avatar
0 votes
0 answers
33 views

Writer.WriteLine System.FormatException [duplicate]

I have some lines that are read from a text file, have some parsing performed on them and are then rewritten to disc using this loop: foreach (KeyValuePair<string, string[]> ...
ScottishTapWater's user avatar
-2 votes
1 answer
73 views

Program does not contain a static 'Main' method test_test suitable for an entry point, C#

CS 5001: Program does not contain a static 'Main' method test_test suitable for an entry point. The above error is given then I try to run the program along with an error attracted to the txt file ...
Erik Lenstrup's user avatar
-1 votes
2 answers
224 views

Convert string lines from a .ini file to int32

My program creates couple string hex numbers and saves it to a .ini file on my computer. Now I want to convert them to int32. In my .ini file the hex values are listed this way: 02E8ECB4 02E8ECB5 ...
Jenis Wunder's user avatar
1 vote
1 answer
461 views

Without Overwriting, is it possible to remove string from a text file?

I am trying to append a line to a text file but by removing the enclosing bracket first. Below is how my text file data format looks like { "1455494402": 8, "1456272000": 2, "1456358400": 1} ...
santhoshkumar B's user avatar
0 votes
1 answer
2k views

StreamWriter encoding string incorrectly

I'm trying to append a base64 string to an existing file. Here's my code: StreamWriter output = new StreamWriter(file, true, Encoding.ASCII); output.WriteLine(output.NewLine + str); Here file is the ...
kgh's user avatar
  • 167
0 votes
1 answer
203 views

Write the value of a variable as well as a string to a text file using StreamWriter

I've written a program which allows the user to input information and store them in a few variables and then output the value of said variables to a text file using StreamWriter. The code is below: ...
SGCSam's user avatar
  • 71
0 votes
0 answers
309 views

text file not updated after write c# Windows Phone 8

I'm trying to write string data into a text file in a Windows Phone 8 app but the text file just would not be updated. I'm writing with the codes below public void update_file(Contact_List[] list) //...
user3502817's user avatar
4 votes
2 answers
2k views

C# removing last delimited field from a string split

I am a beginner c# programmer and just had a quick question on an application I am building. My process reads in multiple files with the purpose of stripping out specific records based on a 1 or 0 ...
user3494110's user avatar
0 votes
1 answer
373 views

Cannot implicitly convert type string to to StreamWriter

I'm trying to split a file in to 10 pieces. This is the way I think I can do it but I'm getting the error mentioned in the title. Is there an easy fix to this problem? StreamWriter a = new ...
Mitchell's user avatar
  • 169
0 votes
1 answer
133 views

Placing a string in memory and saving it later

I have a program that creates a huge string, too large for StringBuilder to handle. I want to store it in memory, then, at a later date, save it to a user defined directory. I have tried a ...
rguarascia.ts's user avatar
0 votes
1 answer
597 views

Append a text file starting from a certain location in the source text file

I want to append a text file (let's say "append.txt") in another text file (let's say "original.txt") but not at last line/character of "original.txt". It should append starting from a certain ...
Computer User's user avatar
2 votes
2 answers
2k views

StreamReader read file and StreamWriter write that result omitting first line?

Using the following code: string lines = ""; using (StreamReader sr = new StreamReader(@"file.txt")) { lines = sr.ReadLine(); } using (StreamWriter writer = new StreamWriter(@"file.txt")) { ...
Keavon's user avatar
  • 7,293

15 30 50 per page