Reputation: 65
I have 3 text boxes and one button. On button click all text from text boxes should be written in text file (in one line). How can i do that?
Upvotes: 0
Views: 125
Reputation: 4219
You can have all textboxes in a List<TextBox>
and at the time of writing do:
list.ForEach(tb => file.Write(tb.Text));
file.WriteLine();
Upvotes: 0
Reputation: 186833
Direct implementation:
File.WriteAllText(dest,
tbID.Text + tbIme.Text + tbPrezime.Text);
Upvotes: 2