123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace Sseessiioonn1
- {
- public partial class Main_Form : Form
- {
- public Main_Form()
- {
- InitializeComponent();
- }
- private void button2_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- string username = Textbox_login.Text;
- string password = Textbox_password.Text;
- if (INUserAuthenticated(username, password))
- {
- MessageBox.Show("Авторизация прошла успешно");
- Glavnoya_form frm = new Glavnoya_form();
- frm.Show();
- this.Hide();
- }
- else
- {
- MessageBox.Show("Ошибка авторизации!");
- }
- }
- private bool INUserAuthenticated(string username, string password)
- {
- if (username == "admin" && password == "admin")
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- }
- }
|