コード例 #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();
        }