TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
ghost ghost
NA
1
1.5k
C# wpf bcrypt verification via sql server table
May 30 2016 3:30 AM
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
Reply
Answers (
1
)
Can anyone tell, From where this Digest value Coming from?
Need help choosing algorithm and topic