Hi All,
I have a website in c# 2008.
I m assigned a task to set the password policy for this web site.
The password Policy goes as under:
1. 1st char is in UpperCase
2. 2nd char is in LowerCase
3. 3rd char is a special char
4. 4th to 8th char are random digits
5. the password expires after 6 months
6. The password can be only 8 chars.
This is really URGENT...I m not able to figure this out. Please advise...
Your advise and support are most appreciated.
Thanks & Regards,
Setting A Password Policy for a web site in c# 2008
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Santhosh Kumar JayaramanRank #563 · 4.3K reputationPosted Jun 28, 2012, 12:56 AM EDT
^([A-Z])([a-z])([+!_%&])([0-9]{5})
([A-Z])- will allow only if first letter is caps
([a-z])-secondletter shud be lowercase
([+!_%&])-third character shud be symbol.I have added only few.
([0-9]{5})-then it should be followed by 5 digits
Regarding password should expire in 6 months, you have to set that in Database. in User table have password changed date, where you insert current date and whenever user logisns, validate it crossed 6 months or not
sample code: