Membership Generate Password alphanumeric only password?

前端 未结 7 2133
独厮守ぢ
独厮守ぢ 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条回答
  •  Happy的楠姐
    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);
    

提交回复
热议问题