Membership Generate Password alphanumeric only password?

前端 未结 7 2084
独厮守ぢ
独厮守ぢ 2020-12-28 13:11

How can I use Membership.GeneratePassword to return a password that ONLY contains alpha or numeric characters? The default method will only guarantee a minimum and not a max

相关标签:
7条回答
  • 2020-12-28 13:37

    I also prefer the GUID method - here's the short version:

    string password = Guid.NewGuid().ToString("N").Substring(0, 8);
    
    0 讨论(0)
提交回复
热议问题