예제 #1
0
    private static void AuthenticateResearcher(string username, string password)
    {
        Researcher researcher = Researcher.Authenticate(username, password);

        if (researcher == null)
        {
            System.Console.WriteLine("error: user could not be authenticated");
            return;
        }
        System.Console.WriteLine("OK: user authenticated");
    }
예제 #2
0
파일: Login.cs 프로젝트: dbaltas/kinoscope
        private void SubmitForm()
        {
            Cursor.Current = Cursors.WaitCursor;
            Researcher authenticatedResearcher = Researcher.Authenticate(txtUsername.Text, txtPassword.Text);

            IsUserAuthenticated = true;
            if (authenticatedResearcher == null)
            {
                MessageBox.Show("Invalid username or password.", "Login failed");
                txtUsername.Focus();
                return;
            }
            Close();
        }