All Questions
Tagged with streamwriter winforms
53
questions
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
2k
views
How do I overwrite a file if it already exists?
I'm making a text editor using fastColoredTextbox. I have a button that allows you to save your text onto your pc. The problem is that it throws an exception when the user tries to save the file as a ...
-1
votes
1
answer
90
views
c#, steamwriter only writes one line
I'm taking data from multiple text files using streamReader and putting it together into one text file using StreamWriter in c#, visual studio. Each text file has multiple lines, each line contains ...
0
votes
1
answer
176
views
How do I use data from a combo box in another form c#
I'm writing a program in c# (visual studio, windows forms) which involves the user selecting a name from a combo box, and then clicking a button which brings them to a quiz on another form. I want a ...
-1
votes
2
answers
99
views
How to choose where append data?
I'm a begginer programmer and I'm learning C#, I have a big difficulty with Files. Someone can help me with this, please?
I created a .txt file and I want to append text choosing the file location ...
0
votes
1
answer
492
views
How do I use Streamwriter to write my code on a new line
Hi I need to create a list in .txt but using these codes I am only able to write data and keying anymore will just overwrite the first one
int score = Convert.ToInt32(ScoreLBL.Text);
...
1
vote
2
answers
145
views
How to write all textboxes content to text file using streamwritter?
I am a civil engineer who is learning to code (so please don't judge). I am using streamwriter to write textboxes data to txt file but I have hundreds of textboxes. Writing texboxes name one by one is ...
0
votes
1
answer
403
views
StreamWriter outputs ... at end of .txt file
I am writing some text from a textbox to a .txt file, and after 40 characters, it just puts a '...'
Here is the code:
//defining the path as a string
string fileName1 = @"C:\Users\-----\AppData\...
0
votes
1
answer
2k
views
splitting a large text file into smaller text files
I'm trying to split a text file based on then number of lines contains around 6M lines and each file should always end (last line) with a certain identifier.
What I tried:
using (System.IO....
0
votes
2
answers
128
views
I'm trying to simply append two different data types into my xml file and read them again, but I am getting an error
I'm using Winforms and I get the following error when I press the load button after having hit the save button:
InvalidOperationException: was not expected.
Here is my code:
private void save_Click(...
0
votes
1
answer
467
views
Calculator History: Adding to an array
I need to create a calculator history for a calculator I am developing in C#.
From OperateBLL.cs I am passing an object and the operators/results to a method in HistoryDAL.cs called WriteHistory, from ...
0
votes
1
answer
43
views
Updating line of a file if array element matches text box
I have a method which currently reads all lines of a directory file (3 fields per line) and updates a directory array with a record of text box entries if the extension code entered matches an ...
0
votes
1
answer
78
views
How do I append only updated texts?
I have a Winform control to write notes whose contents are periodically uploaded to the server.
I need to create a local file as a backup to save the contents of the notes.
When I type text into the ...
-1
votes
1
answer
206
views
Streamwriter overrides line [duplicate]
Program: An image gets shown, for this image the user can select different radiobuttons options, when user submits, image path and the values of radiobuttons gets written in the logfile.
Problem: The ...
29
votes
3
answers
121k
views
How To Overwrite A File If It Already Exists?
I'm making a music player. It has 2 forms; one is the main area where you play music. The second form has a CheckedListBox where you select the mp3s you want.
When I click a button, it saves the ...