Rebuilding the Enterprise - Software, Hardware and Peopleware Migrations for the Systems Architect

5/20/2014

Generate Passwords with Membership Provider

5/20/2014 Posted by William Berry No comments
To solidly rip off DotNetRocks ... today's installment of "Better Know a Framework's Methods", we bring you the Generate Password method of the Membership class in System.Web.Security namespace.

  1 public static string GeneratePassword(
  2     int length, 
  3     int numberOfNonAlphanumericCharacters 
  4 )

The method is clearly super simple to use, taking in an overall length of password and count of non-alphanumeric characters to seed the password with.  I am sure there are all sorts of pitfalls to using this; but frankly, for a fast solution to generating passwords for zip files... this fits the bill nicely.

0 comments:

Post a Comment