此问题在此处已有答案:
This implementation is not part of the Windows Platform FIPS validated cryptographic algorithms when building an app with visual studio(5个答案)
8天前关闭
当从postgresql数据库中获取数据时,面临图像中显示的错误。
[HttpPost]
public ActionResult UserLogin(LoginModel login)
{
string connString = "HOST = 172.18.0.202; PORT = 5432; DATABASE = MRSAC; PASSWORD = MRSACGEOTAG@123; USER ID = MRSACGEOTAG";
try
{
NpgsqlConnection con = new NpgsqlConnection(connString);
string query = "select userlogin,password from \"MRSACGEOTAG\".\"loginadminmaster\" where userlogin ='" + login.userlogin + "' and password ='" + login.password + "' ";
DataTable dt = new DataTable();
NpgsqlCommand cmd = new NpgsqlCommand(query, con);
con.Open();
NpgsqlDataAdapter ngpsqlAdp = new NpgsqlDataAdapter(cmd);
NpgsqlDataReader dr;
dr = cmd.ExecuteReader();
if (dr.Read())
{
con.Close();
//return View("Create");
FormsAuthentication.SetAuthCookie(login.userlogin,false);
return RedirectToAction("Dashboard", "Dashboard");
}
else
{
con.Close();
ViewBag.errmsg = "Not valid Credentials";
}
return View("LandingPage");
}
catch (Exception ex)
{
throw (ex);
}
}
字符串
我遇到了这个错误:System.Reflection. TargetExceptionException:'Exception has been thrown by the target of an invocation'。
InnerException:InvalidOperationException:此实现不是Windows平台FIPS验证的加密算法的一部分。
我试着更新PostgreSQL版本,但它面临着同样的问题。
1条答案
按热度按时间afdcj2ne1#
错误消息
exception was thrown by the target of invocation
是一个一般性错误,它没有提供有关导致异常的具体细节,您必须查看异常对象的InnerException属性,这将给予您抛出的实际异常,以及更有用的堆栈跟踪。此外,由于存在SQL注入攻击的风险,因此不建议连接字符串以形成SQL查询。相反,请使用参数化查询来防止此漏洞。