How to customize password generation in ASP.NET

ASP.NET Membership provides for the Membership.GeneratePassword method for randomly generating user passwords. This can be customized using the length and number of non alphanumeric characters parameters:

Dim length As Integer = 8
Dim numberOfNonAlphanumericCharacters As Integer = 1
Dim passStr As String

passStr = Membership.GeneratePassword(length, numberOfNonAlphanumericCharacters)

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>