// Procedura logowania, wyswietla status weryfikacji klienta przez serwer public MainFrame Logging() { MainFrame mainFrame = new MainFrame(textBox1.Text, ServerPubKey, PrivateKey); if (server.status == "Connected") { this.label3.Text = "Connected"; this.Refresh(); System.Threading.Thread.Sleep(1500); this.Hide(); server.action(mainFrame); mainFrame.ServerPubKey = ServerPubKey; mainFrame.loadKey(PrivateKey); } else { this.label3.Text = server.status; } return mainFrame; }
// Ujawnia formularz logowania public void action(MainFrame x) { x.Show(); }
// Autoryzuje klienta public MainFrame Logging(Login login) { if (dict.ContainsKey(userLogin) ) { if (password == dict[userLogin]) { status = "Connected"; mainFrame = login.Logging(); UpdatePrices(); } else { status = "Wrong password"; mainFrame = login.Logging(); } } else { status = "User doesn't exist"; mainFrame = login.Logging(); } return mainFrame; }