Membership.CreateUser(username,password,email)报InvalidPassword错误

ueroom 2007-01-18 12:18:57
//username,password,email都有正确的值
走到这步就给我来个错误:
Membership InvalidPassword 是为何???????????????????????????????
求解决方法!!!!
...全文
328 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
对了还有长度限制,几个长符的长忘了.
  • 打赏
  • 举报
回复
使用你的电子邮件做密码.默认情况下,密码需要非字母和数字字符.
也就是你得输入一个什么@ # & ....
sheng9hhd 2007-01-18
  • 打赏
  • 举报
回复
public static string GetSecuritySHA1Value(string _source)
{
byte[] buffer = new byte[16];
(new RNGCryptoServiceProvider()).GetBytes(buffer);
string salt = Convert.ToBase64String(buffer);
byte[] bIn = Encoding.Unicode.GetBytes(_source);
byte[] bSalt = Convert.FromBase64String(salt);
byte[] bAll = new byte[bSalt.Length + bIn.Length];
byte[] bRet = null;

Buffer.BlockCopy(bSalt, 0, bAll, 0, bSalt.Length);
Buffer.BlockCopy(bIn, 0, bAll, bSalt.Length, bIn.Length);
// MembershipPasswordFormat.Hashed
HashAlgorithm s = HashAlgorithm.Create("SHA1");
if (s == null) throw new ProviderException("Could not create a hash algorithm");
bRet = s.ComputeHash(bAll);
return Convert.ToBase64String(bRet);
}
ueroom 2007-01-18
  • 打赏
  • 举报
回复
问题已解决,密码需要加密
ueroom 2007-01-18
  • 打赏
  • 举报
回复
没人会阿???
zdyguilong 2007-01-18
  • 打赏
  • 举报
回复
顶一下

62,025

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧