public partial class Form1 : Form { string filename = @"D:\Text1.txt"; public Form1() { InitializeComponent(); } private void label1_Click(object sender, EventArgs e) { } private void label2_Click(object sender, EventArgs e) { } private void Form1_Load(object sender, EventArgs e) { } private void button1_Click(object sender, EventArgs e) { try { var Кодировка = System.Text.Encoding.GetEncoding(1251); var Писатель = new System.IO.StreamWriter(filename, false, Кодировка); Писатель.Write("ФИО: " + textBox1.Text + "\n"+ "E-mail: " + textBox2.Text); Писатель.Close(); } catch (SystemException Ситуация) { MessageBox.Show(Ситуация.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } private void button2_Click(object sender, EventArgs e) { } private void radioButton5_CheckedChanged(object sender, EventArgs e) { } private void textBox2_TextChanged(object sender, EventArgs e) { } private void radioButton4_CheckedChanged(object sender, EventArgs e) { } private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { } private void monthCalendar1_DateChanged(object sender, DateRangeEventArgs e) { } } 

} enter image description here

Closed due to the fact that the question is not clear to the participants of the default locale , MSDN.WhiteKnight , 0xdb , Kromster , Anton Shchyrov Nov 29 '18 at 14:35 .

Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • Long ago, I suffer with StreamWriter and SreamReader. I would be glad if you can help - Elikor
  • one
    So what's the problem then? - tym32167
  • in that I have no idea how to transfer these very data elements so that it turned out as in the example in the picture - Elikor
  • Another very interesting issue with GroupBox2. At radioButton5 (with the word “other”) it is necessary to convert textBox4 from the state Enabled = false to true - Elikor
  • one
    Well, how did you try to solve your problem? Maybe some thoughts on how this could be done? Here you have, in fact, controls on the form, there are values ​​in them, then you can count them. What to write to the file, you also know. Because I did not understand what specifically makes it difficult for you? - tym32167

1 answer 1

 List<string> fr = new List<string>(); private void button2_Click(object sender, EventArgs e) { fr.Add("текст1"); } private void radioButton5_CheckedChanged(object sender, EventArgs e) { fr.Add("текст1"); } private void textBox2_TextChanged(object sender, EventArgs e) { fr.Add("текст1"); } private void radioButton4_CheckedChanged(object sender, EventArgs e) { fr.Add("текст1"); } private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { fr.Add("текст1"); } private void monthCalendar1_DateChanged(object sender, DateRangeEventArgs e) { fr.Add("текст1"); } System.IO.File.WriteAllLines("C://awd.txt", fr);