HashPasswordForStoringInConfigFile已过时
发布时间:2021/12/17 17:45:37 作者:Admin 阅读:772
广告:
警告 CS0618 “FormsAuthentication.HashPasswordForStoringInConfigFile(string, string)”已过时:“The recommended alternative is to use the Membership APIs, such as Membership.CreateUser. For more information, see http://go.microsoft.com/fwlink/?LinkId=252463.” FeiShareLibrary E:\aspnet2.0\53BK公司网站-net-家里\FeiShareLibrary\Haocookie.cs 79 活动
FormsAuthentication.HashPasswordForStoringInConfigFile(string, string)
System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile
System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(sKey, "md5")
换成: NewMD5(sKey, "md5")
public static string NewMD5(string strData,string md5str)
{
string strResult = "";
using (var md5 = MD5.Create())
{
var result = md5.ComputeHash(Encoding.UTF8.GetBytes(strData));
strResult = BitConverter.ToString(result);
strResult= strResult.Replace("-", "").ToUpper();
}
return strResult;
}
广告:
相关文章


