DevPinoy.org
A Filipino Developers Community

>>> First two to make 3 wins! <<<

password control - need help.

rated by 0 users
This post has 4 Replies | 1 Follower

Top 500 Contributor
Posts 3
Points 45
mhidnight_hunter Posted: 04-27-2008 10:57 PM

Hey guyz im currently studying vb6 and just wondering if you could help me... well im currently working on a simple log in system and im trying to put some condition when registering the password.

here's the list of condition:

1. character must be minimum of 5 and maximum of 12. - (i already got this)

2. must contained atleast 3 numeric number.

3. no repeated phrase.

example: 365coconut = invalid because of the "co"

4. all of the character must be in lowercase.

 

 

 

 

 

 

Wars come and go, but my soldier stay eternal.
  • | Post Points: 35
Top 10 Contributor
Posts 751
Points 10,140

Hi!

I'm not actually a VB programmer, but I looked at your questions and just had a couple of ideas on how I would do it. Remember, these are only suggestions. :D

2. Must contain 3 numeric characters
You could test each character, then increment a counter if it encounters a number. After all the characters has been checked, compare the counter if it is greater or equal to 3, then the condition passes.

3. No repeated phrase.
Test each character, if the character is a number, skip it, else put it in an array. Append each found character to the array. After all is done, compare the first character with the other characters in array. If there is no match, the condition passes. If it finds a match, get the second character, check with the other characters in the array. If there is a match, the whole condition fails. If no match was found after the second check, then the condition passes.

4. Lowercase
I think there a function for checking this. If not, get each character, check its value, (ex: uppercase is 41 to 5A), if it falls under the range of the uppercase characters, then the condition fails, else, continue checking.

I hope it made sense.

  • Filed under:
  • | Post Points: 20
Top 500 Contributor
Posts 3
Points 45

yeah sir... i know the logic flow of the case but still i don't know what function will use in this scenario...

but the lower case i have an idea but still have to check if it will work.. 

 

Wars come and go, but my soldier stay eternal.
  • | Post Points: 5
Top 10 Contributor
Posts 953
Points 22,750

etong mga ganito magandang i-TDD demo Wink or you can also study regular expressions, like here: http://www.regular-expressions.info/vb.html

http://devpinoy.org/blogs/cruizer
Naglalayong buksan at palayain ang kamalayan ng Pinoy .NET developer
  • | Post Points: 20
Top 10 Contributor
Posts 751
Points 10,140

Boss cruizer, tanong ko lang, ano yung "i-TDD demo"? Thanks.

  • Filed under:
  • | Post Points: 5
Page 1 of 1 (5 items) | RSS

Copyright DevPinoy 2005-2008