public void SifreKontrol(string username, string pass) { if (!InternetKontrol()) { return; } using (var bdb = new BrowserContext(baglanti)) { User user = bdb.UserSet.FirstOrDefault(u => u.username == username); if (user == null) { MessageBox.Show("Kullanıcı Adı Yanlış!"); return; } if (user.pass != pass) { MessageBox.Show("Şifre Yanlış!"); return; } if (user.Durum == 1 && username != "admin") { MessageBox.Show("Bir Kullanıcı ile Aynı Anda Yalnızca Tek Giriş Yapılabilir."); return; } if (user.username == "admin" && user.pass == pass) { } else { if (!InternetKontrol()) { return; } } Form1 frm = (Form1)Application.OpenForms["Form1"]; if (yetki == "admin") { if (user.username != yetki) { MessageBox.Show("Giriş İzniniz Yok!"); return; } } if (user.Izin == 0) { MessageBox.Show("Giriş İzniniz Yok!"); return; } user.Durum = 1; frm.label1.Text = user.AdSoyad + " Hoşgeldiniz"; bdb.SaveChanges(); frm.user = user; frm.timer1.Enabled = true; Taskbar.Goster(); this.Close(); } }
public LoginForm() { InitializeComponent(); xmlOku(); RegistryIslemleri(); Taskbar.Gizle(); ProcessModule objCurrentModule = Process.GetCurrentProcess().MainModule; objKeyboardProcess = new LowLevelKeyboardProc(captureKey); ptrHook = SetWindowsHookEx(13, objKeyboardProcess, GetModuleHandle(objCurrentModule.ModuleName), 0); FormBorderStyle = FormBorderStyle.None; this.WindowState = FormWindowState.Maximized; this.TopMost = true; }