public static usrInfo GetOUsrInfo(string usr) { usrInfo info = new usrInfo(); SqlDataReader read = SQLOpen("SELECT * FROM usersTable WHERE username1='" + usr + "'"); if (read.HasRows == false) { read.Close(); return(info); } read.Read(); info.id = read["userID"].ToString(); info.username = read["username1"].ToString(); info.password = read["password1"].ToString(); info.firstname = read["firstname1"].ToString(); info.lastname = read["lastname1"].ToString(); info.address = read["address1"].ToString(); info.city = read["city1"].ToString(); info.state = read["state1"].ToString(); info.zip = read["zip1"].ToString(); info.type = read["type1"].ToString(); info.address2 = read["address2"].ToString(); info.city2 = read["city2"].ToString(); info.state2 = read["state2"].ToString(); info.zip2 = read["zip2"].ToString(); return(info); }
public static usrInfo GetOUsrInfo(string usr) { usrInfo info = new usrInfo(); SqlDataReader read = SQLOpen("SELECT * FROM usersTable WHERE username1='" + usr + "'"); if (read.HasRows == false) { read.Close(); return info; } read.Read(); info.id = read["userID"].ToString(); info.username = read["username1"].ToString(); info.password = read["password1"].ToString(); info.firstname = read["firstname1"].ToString(); info.lastname = read["lastname1"].ToString(); info.address = read["address1"].ToString(); info.city = read["city1"].ToString(); info.state = read["state1"].ToString(); info.zip = read["zip1"].ToString(); info.type = read["type1"].ToString(); info.address2 = read["address2"].ToString(); info.city2 = read["city2"].ToString(); info.state2 = read["state2"].ToString(); info.zip2 = read["zip2"].ToString(); return info; }
public bool validate([FromBody] usrInfo usrname) { var rng = new Random(); var model = new BorgWarnerMisSQLContext(); var usr = usrname.username; var testData = model.Database.SqlQuery <usrDBO>($"select Password from dbo.tblWebUser where UsrName='{usr}' ").ToList(); if (testData.Count == 0) { return(false); } //前端密文解密 // string oriText = await _services.InvokeAsync<string>("./src/scripts/decrypt",usrname.happyword); // string testORI = DecryptByAES(usrname.happyword,"secretkey1234567"); var validate = PasswordHasher.VerifyHashedPassword(usrname.happyword, testData[0].Password); return(validate); }
public static usrInfo GetUsrInfo(string sID) { usrInfo info = new usrInfo(); SqlDataReader read = SQLOpen("SELECT * FROM users WHERE session='" + sID + "'"); read.Read(); info.id = read["userID"].ToString(); info.username = read["username"].ToString(); info.password = read["password"].ToString(); info.firstname = read["firstname"].ToString(); info.lastname = read["lastname"].ToString(); info.address = read["address"].ToString(); info.city = read["city"].ToString(); info.state = read["state"].ToString(); info.zip = read["zip"].ToString(); info.type = read["type"].ToString(); info.email = read["email"].ToString(); info.OrgID = read["OrgID"].ToString(); return info; }
public static usrInfo GetUsrInfo(string sID) { usrInfo info = new usrInfo(); SqlDataReader read = SQLOpen("SELECT * FROM users WHERE session='" + sID + "'"); read.Read(); info.id = read["userID"].ToString(); info.username = read["username"].ToString(); info.password = read["password"].ToString(); info.firstname = read["firstname"].ToString(); info.lastname = read["lastname"].ToString(); info.address = read["address"].ToString(); info.city = read["city"].ToString(); info.state = read["state"].ToString(); info.zip = read["zip"].ToString(); info.type = read["type"].ToString(); info.email = read["email"].ToString(); info.OrgID = read["OrgID"].ToString(); return(info); }