Facebook
From Corrupt Parakeet, 5 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 258
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Diagnostics;
  7. using System.IO;
  8.  
  9.  
  10.  
  11.  
  12. namespace ConsoleApp1
  13. {
  14.     class Program
  15.     {
  16.  
  17.         static void Main(string[] args)
  18.         {
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.             Console.WriteLine("tworzymy nowe konto: ");
  27.  
  28.  
  29.             string login, haslo = string.Empty;
  30.  
  31.             Console.Write("podaj unsername: ");
  32.             login = Console.ReadLine();
  33.             Console.Write("podaj password:");
  34.             haslo = Console.ReadLine();
  35.  
  36.            
  37.             using (StreamWriter sw = new StreamWriter(File.Create("D:\\2.txt")))
  38.             {
  39.  
  40.                 sw.Write(login);
  41.                 sw.WriteLine(haslo);
  42.                 sw.Close();
  43.  
  44.  
  45.             }
  46.  
  47.             string login1, haslo1 = string.Empty;
  48.  
  49.             Console.WriteLine("podaj login: ");
  50.                login1 =  Console.ReadLine();
  51.             Console.WriteLine("podaj haslo: ");
  52.             haslo1 = Console.ReadLine();
  53.  
  54.  
  55.             using (StreamReader sr = new StreamReader(File.Open("D:\\2.txt", FileMode.Open)))
  56.             {
  57.  
  58.                 login1 = sr.ReadLine();
  59.                 haslo1 = sr.ReadLine();
  60.                 sr.Close();
  61.  
  62.  
  63.             }
  64.  
  65.  
  66.  
  67.             if (login == login1 && haslo == haslo1)
  68.             {
  69.  
  70.                 Console.WriteLine("dobrze");
  71.  
  72.  
  73.             }
  74.             else
  75.             {
  76.                 Console.WriteLine("zle");
  77.             }
  78.  
  79.  
  80.             Console.Read();
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.         }
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.     }
  133. }
  134.