Password Generator
-
Does anyone have any idea how to create a password gnerator that changes everyday. what i'm trying to do is have an admistrator password that changes everyday, Less likely that someone will use it without a persons consent.:wtf: Any Ideas on how this could be created?:^) Thanks:laugh: You are you and I am I. So who is that?
-
Does anyone have any idea how to create a password gnerator that changes everyday. what i'm trying to do is have an admistrator password that changes everyday, Less likely that someone will use it without a persons consent.:wtf: Any Ideas on how this could be created?:^) Thanks:laugh: You are you and I am I. So who is that?
in your application on load. check if user has changed the password today. if not then prompt him to change. for this keep one column in DB "LastChangedOn". to keep the track.
-
in your application on load. check if user has changed the password today. if not then prompt him to change. for this keep one column in DB "LastChangedOn". to keep the track.
Thanks for the info. What i'm thinking of doing is have the password automatically generate a new password everyday for the system. I know it has to be done using the date, but I don't know how You are you and I am I. So who is that?
-
Thanks for the info. What i'm thinking of doing is have the password automatically generate a new password everyday for the system. I know it has to be done using the date, but I don't know how You are you and I am I. So who is that?
This will generate a password of random characters with a length of 10 characters. You could modify this to include the date as part of the generation process.
Private Sub btnGeneratePassword_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGeneratePassword.Click Dim RandomNo As New Random Dim x As Integer Dim y As Integer Dim Chars As String Chars = "1234567890abcdefghijklmnopqrstuvwxyz" Chars += "ABCDEFGHIJKLMNOPQRSTUVWXYZ~!@#$%^&*()[]{};:<>?/.," Count = CInt(numLength.Text) txtPassword.Text = "" For y = 0 To 10 ' Number of chars in password If chkUseSpecial.Checked Then x = RandomNo.Next(0, Chars.Length - 1) Else x = RandomNo.Next(0, Chars.Length - 24) End If txtPassword.Text += Chars.Chars(x) Next End Sub
PS: Codeproject could do a better job at formatting the code above!:sigh: -
This will generate a password of random characters with a length of 10 characters. You could modify this to include the date as part of the generation process.
Private Sub btnGeneratePassword_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGeneratePassword.Click Dim RandomNo As New Random Dim x As Integer Dim y As Integer Dim Chars As String Chars = "1234567890abcdefghijklmnopqrstuvwxyz" Chars += "ABCDEFGHIJKLMNOPQRSTUVWXYZ~!@#$%^&*()[]{};:<>?/.," Count = CInt(numLength.Text) txtPassword.Text = "" For y = 0 To 10 ' Number of chars in password If chkUseSpecial.Checked Then x = RandomNo.Next(0, Chars.Length - 1) Else x = RandomNo.Next(0, Chars.Length - 24) End If txtPassword.Text += Chars.Chars(x) Next End Sub
PS: Codeproject could do a better job at formatting the code above!:sigh:Thanks for that. I'll try it tonight after work. I know what you mean about formatting it a bit :~ Anyway. Can you try this for me, If you have time,
Public Function GeneratePassword(ByVal passwordLength As Integer) As String Dim Vowels() As Char = New Char() {"a", "e", "i", "o", "u"} Dim Consonants() As Char = New Char() {"b", "c", "d", "f", "g", "h", "j", "k", "l", "m", "n", "p", "r", "s", "t", "v"} Dim DoubleConsonants() As Char = New Char() {"c", "d", "f", "g", "l", "m", "n", "p", "r", "s", "t"} Dim wroteConsonant As Boolean 'boolean Dim counter As Integer Dim rnd As New Random Dim passwordBuffer As New StringBuilder wroteConsonant = False For counter = 0 To passwordLength If passwordBuffer.Length > 0 And (wroteConsonant = False) And (rnd.Next(100) < 10) Then passwordBuffer.Append(DoubleConsonants(rnd.Next(Do ubleConsonants.Length)), 2) counter += 1 wroteConsonant = True Else If (wroteConsonant = False) And (rnd.Next(100) < 90) Then passwordBuffer.Append(Consonants(rnd.Next(Consonan ts.Length))) wroteConsonant = True Else passwordBuffer.Append(Vowels(rnd.Next(Vowels.Lengt h))) wroteConsonant = False End If End If Next 'size the buffer passwordBuffer.Length = passwordLength Return passwordBuffer.ToString End Function
Found it on the internet. Iv'e only just started programming, but I assumed that because it was a function. to get it to display, all I would need to do istext_change event textbox1.text = GeneratePassword
But VB.net says tjhat it's not a string???? :wtf: Any ideas? P.s. I think I might go with your's. i'm just trying to understand how to display this. Thanks ---------------------------------------------- You are you and I am I. So who is that?