Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 WindowsFormsApp1
- {
- public partial class Form2 : Form
- {
- public void saveTextToFile(string filename, string textToSave)
- {
- try
- {
- File.WriteAllText(filename, textToSave); //сохранение данных тут
- }
- catch (Exception ex)
- {
- MessageBox.Show("Ошибко тут: " + ex.Message);
- }
- }
- public Form2()
- {
- InitializeComponent();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- saveTextToFile(textBox2.Text, textBox1.Text + " " + textBox2.Text + " " + textBox3.Text);
- Form3 form3 = new Form3(this.textBox1.Text, this.textBox2.Text, this.textBox3.Text);
- form3.txt2 = this.textBox2.Text; //объявление ссылок
- form3.txt1 = this.textBox1.Text;
- form3.txt3 = this.textBox3.Text;
- }
- private void button2_Click(object sender, EventArgs e)
- {
- Close();
- }
- private void Form2_Load(object sender, EventArgs e)
- {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement