Hello all,
I have a small problem that I would like to ask for help on. I appreciate anyone's reply.
I have to convert a program of mine over to C#, however, I am new at C#. I know a good amount of VB.NET, but the C# language is a little foreign to me.
My vb code is:
Private Sub PassOKButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PassOKButton.Click
If _userTextBox.Text = My.Settings.Username AndAlso _passTextBox.Text.GetHashCode() = My.Settings.PasswordHashcode Then
MessageBox.Show("Access Granted!")
MessageBox.Show("You must login everytime to access the Admin Panel!")
AdminPanel.Label3.Visible = False
AdminPanel.Show()
Me.Close()
Else
MessageBox.Show("Wrong Username or Password")
End If
and I have tried to redo it and I am getting stuck. My C# code is:
private void _loginbtn_Click(object sender, EventArgs e)
{
if (_usernametxt == Properties.Settings.Default.adminusername && _passwordtxt.Text.GetHashCode() == Properties.Settings.Default.adminpass)
{
MessageBox.Show("Wrong Username and/or Password.", "Admin Login",
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
this.Close();
}
else
{
MessageBox.Show("Wrong Username or Password");
}
}
}
}
but I am throwing errors. Everytime I try to fix one another couple errors appear.
Does anyone know what I am doing wrong.
Thank you in advanced
daveofgv