Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Password Generator

Password Generator

Scheduled Pinned Locked Moved Visual Basic
csstutorialquestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    PixelPixie
    wrote on last edited by
    #1

    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?

    R 1 Reply Last reply
    0
    • P PixelPixie

      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?

      R Offline
      R Offline
      Rizwan Bashir
      wrote on last edited by
      #2

      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.

      P 1 Reply Last reply
      0
      • R Rizwan Bashir

        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.

        P Offline
        P Offline
        PixelPixie
        wrote on last edited by
        #3

        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?

        D 1 Reply Last reply
        0
        • P PixelPixie

          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?

          D Offline
          D Offline
          Daniel1324
          wrote on last edited by
          #4

          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:

          P 1 Reply Last reply
          0
          • D Daniel1324

            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:

            P Offline
            P Offline
            PixelPixie
            wrote on last edited by
            #5

            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 is text_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?

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups