| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 | using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows.Forms;using System.IO;namespace СУБД_Агентство{    public partial class FormDataRielter : Form    {        public FormDataRielter()        {            InitializeComponent();        }        private void FormDataRielter_Load(object sender, EventArgs e)        {            try            {                // открыть файл для чтения                StreamReader sr = new StreamReader("data.txt");                // прочитать данные из файла                 tbxMaxKlient.Text = sr.ReadLine();                tbxProcPredl.Text = sr.ReadLine();                tbxProcPotreb.Text = sr.ReadLine();                sr.Close();  // закрыть файл            }            catch { }        }        private void btnSave_Click(object sender, EventArgs e)        {            try            {                // открыть файл для записи                StreamWriter sw = new StreamWriter("data.txt");                // сохранить данные в файл                sw.WriteLine(tbxMaxKlient.Text);                sw.WriteLine(tbxProcPredl.Text);                sw.WriteLine(tbxProcPotreb.Text);                sw.Close();  // закрыть файл            }            catch { }        }    }}
 |