using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace WindowsFormsApp7 { public partial class Form3 : Form { public Form3() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { if (textBox1.Text == textBox2.Text) { using (StreamWriter sw = new StreamWriter(@"‪C:\Nowy dokument tekstowy.txt", true)) { sw.WriteLine(string.Format("{ 0}|{1}"), textBox2.Text, textBox3.Text); } MessageBox.Show("Udało sie zarejestrować!", "zarejestrowany!", MessageBoxButtons.OK, MessageBoxIcon.Information); Form3 form3 = new Form3(); form3.Show(); this.Hide(); } else { MessageBox.Show("Hasło nie są identyczne!", "Błąd", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } }