Here is code for the registration. how to code in login to get data username that matching with the password
public class UserReg
{
public string userName { get; set; }
public string password { get; set; }
public string role { get; set; }
}
private void btnRegister_Click(object sender, EventArgs e)
{
var client = new MongoClient();
var db = client.GetDatabase("Project_1");
var collection = db.GetCollection<UserReg>("UserReg");
UserReg userReg = new UserReg();
userReg.userName = txtUsername.Text.ToString();
userReg.password = hc.HashPass(txtPassword.Text.ToString());
userReg.role = cboRole.Text.ToString();
collection.InsertOneAsync(userReg);
}