Facebook
From Colorant Macaque, 3 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 145
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.IO;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. using System.Windows.Forms;
  11.  
  12. namespace WindowsFormsApp7
  13. {
  14.     public partial class Form3 : Form
  15.     {
  16.         public Form3()
  17.         {
  18.             InitializeComponent();
  19.         }
  20.  
  21.         private void button1_Click(object sender, EventArgs e)
  22.         {
  23.             if (textBox1.Text == textBox2.Text)
  24.             {
  25.  
  26.  
  27.                 using (StreamWriter sw = new StreamWriter(@"‪C:\Nowy dokument tekstowy.txt", true))
  28.                 {
  29.  
  30.                     sw.WriteLine(string.Format("{ 0}|{1}"), textBox2.Text, textBox3.Text);
  31.  
  32.                 }
  33.                 MessageBox.Show("Udało sie zarejestrować!", "zarejestrowany!", MessageBoxButtons.OK, MessageBoxIcon.Information);
  34.                 Form3 form3 = new Form3();
  35.                 form3.Show();
  36.                 this.Hide();
  37.             }
  38.             else
  39.             {
  40.                 MessageBox.Show("Hasło nie są identyczne!", "Błąd", MessageBoxButtons.OK, MessageBoxIcon.Information);
  41.  
  42.             }
  43.  
  44.  
  45.         }
  46.  
  47.     }
  48. }  
  49.  
  50.