Groups | Blog | Home
all groups > asp.net security > july 2007 >

asp.net security : ResetPassword() to Alpha-numeric?


WB
7/24/2007 11:32:04 PM
Hi,

Is there any way to specify ResetPassword() of the MembershipUser class to
generate passwords of only alpha-numeric characters?


Thanks,
Manish Bafna
7/25/2007 3:48:00 AM
Hi,
The GeneratePassword method is used to generate a random password and is
most commonly used by the ResetPassword method implemented by a membership
provider to reset the password for a user to a new, temporary password.
// Generate a new 12-character password with 0 non-alphanumeric character.
string password = Membership.GeneratePassword(12, 0);
ref:http://msdn2.microsoft.com/en-us/library/system.web.security.membership.generatepassword.aspx
--
Hope this answers your question.
Thanks and Regards.
Manish Bafna.
MCP and MCTS.



[quoted text, click to view]
WB
7/25/2007 8:36:03 AM
Hi Manish,

That doesn't work because the second parameter is for "minimum number of
punctuation characters".

So even if you put 0, it can still generate a password containing multiple
non-alphanumeric characters.

Any other ideas?


Thanks,
wb



[quoted text, click to view]
AddThis Social Bookmark Button