Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
1
Reply
C# wpf bcrypt verification via sql server table
ghost ghost
May 30 2016 3:30 AM
651
Reply
private
void
UserInputKeyDown(
object
sender, KeyEventArgs e)
{
if
(e.Key == Key.Enter)
//only accepts enter key
{
string
dbconnection = ConfigurationManager.ConnectionStrings[
"OverwatchDatabase"
].ConnectionString;
SqlConnection connection =
new
SqlConnection(dbconnection);
connection.Open();
if
(connection.State == ConnectionState.Open)
{
MessageBox.Show(
"You have been successfully connected to the database!"
);
SqlCommand Password_Hash =
new
SqlCommand(
"SELECT Password_Hash"
+
"From dbo.Authorized_Personnel"
, connection);
//Password_Hash is the column name and Authorized_Personnel is the tables name
bool
Authenticate = BCrypt.Net.BCrypt.Verify(UserInput.Password, Password_Hash);
//UserInput.Password is the password box on my wpf application
if
(Authenticate ==
true
)
{
MessageBox.Show(
"Authentication Successful"
);
connection.Close();
//closes the connection to database
mainscreen =
new
MainScreen();
mainscreen.Show();
this
.Close();
}
else
{
MessageBox.Show(
"Authentication Failed"
);
Application.Current.Shutdown();
}
}
else
{
MessageBox.Show(
"Connection failed."
);
}
}
}
I'm having trouble authenticating against my sql server with bcrypt if anyone can help and explain what going on that would very much appreciated
its throwing an error at the moment saying cannot convert system.dat.sqlclinet.sqlcommand to string
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
Can anyone tell, From where this Digest value Coming from?
Need help choosing algorithm and topic