Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Data;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using System.Windows.Navigation;
- using System.Windows.Shapes;
- namespace LogowanieForm
- {
- /// <summary>
- /// Logika interakcji dla klasy MainWindow.xaml
- /// </summary>
- public partial class MainWindow : Window
- {
- public MainWindow()
- {
- InitializeComponent();
- }
- private void zalogujBt_Click(object sender, RoutedEventArgs e)
- {
- string uzytkownik = this.nazwaUzytktxt.Text;
- string haslo = this.hasloUzyttxt.Password;
- if (SprawdzNazweiHaslo(uzytkownik, haslo))
- {
- //MessageBox.Show("Jest w systemie", "Zaalogowano");
- logowanieFrm.Hide();
- // dalej tutaj mozecie tworzyc nowe formularze i dalsza czesc programu ...
- GlowneOkno fr = new GlowneOkno();
- fr.Show();
- //logowanieFrm.Close();
- }
- else
- {
- MessageBox.Show("Niepoprawna nazwa użytkownika lub hasło","Błąd logowania");
- return;
- }
- }
- public bool SprawdzNazweiHaslo(string uzytkownik, string haslo)
- {
- if (uzytkownik == "Andrzej" & haslo == "andrzej")
- return true;
- else
- return false;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement