Generate a password with your lower security set of characters. Then upper
case randomizally some letters and finally inserts special chars at
randomized positions.
I don't know if you like the proposition, but it can help.
Jonathan Boivin
"Morten Snedker" <mo************@gmail.coma écrit dans le message de news:
%2****************@TK2MSFTNGP03.phx.gbl...
You certainly got a point there that I missed myself. Thanks for your
input.
Back to the drawing table :-)
Regards /Snedker
Family Tree Mike skrev:>Your medium and complex modes do not force the generator to pick from the
other datasets, even though you add them to the list of random
characters. This means that in a given scenario, even if you pass in
"complex", you could get a password of "boogiewoogie" (just an example,
all from the lower case). Random doesn't guarantee one from each set, is
what I am getting at. Our company requres the complex set, but at least
one from each group.
"Morten Snedker" wrote:
>>I'm using this for generating passwords. It seems to function okay.
Anything you guys reckon I missed out on?
'** CODE BEGIN
Public Class GeneratePassword
Public Shared Function GeneratePassword(ByVal Length As
Integer, ByVal Complexity As Complexity) As String
Dim characters As String =
"abcdefghijklmnopqrstuvwxyz1234567890"
If Complexity = Complexity.Medium Or Complexity =
Complexity.Complex Then
characters += "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
End If
If Complexity = Complexity.Medium Then
characters += "!#%&/()=? "
End If
Dim password As String = ""
Dim random As New Random
For i As Integer = 0 To Length
password += characters.Substring(random.Next(0,
characters.Length - 1), 1)
Next
Return password
End Function
Public Enum Complexity
Simple
Medium
Complex
End Enum
End Class
'** CODE END
Regards /Snedker