生成随机密码 [英] Generating Random Passwords
问题描述
在我们网站上的用户失去了他的密码和后仰到丢失的密码页面,我们需要给他一个新的临时密码。我不介意怎么乱,这是,或者如果它所有的需要强密码规则相匹配,所有我想要做的就是给他们一个密码,他们可以在以后更改。
When a user on our site looses his password and heads off to the Lost Password page we need to give him a new temporary password. I don't really mind how random this is, or if it matches all the "needed" strong password rules, all I want to do is give them a password that they can change later.
该应用程序是用C#编写一个Web应用程序。所以我想的小气,会使用一个GUID的一部分的轻松路线。即。
The application is a Web application written in C#. so I was thinking of being mean and going for the easy route of using part of a Guid. i.e.
Guid.NewGuid().ToString("d").Substring(1,8)
Suggesstions?什么想法?
Suggesstions? thoughts?
推荐答案
有总是<一个href=\"http://msdn.microsoft.com/en-us/library/system.web.security.membership.generatepassword.aspx\"><$c$c>System.Web.Security.Membership.GeneratePassword(int长度,INT numberOfNonAlphanumericCharacters )。
这篇关于生成随机密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!