1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

I need a help of a vb developer ..

Discussion in 'Software Development' started by TheLord, Feb 2, 2005.

Thread Status:
Not open for further replies.
Advertisement
  1. TheLord

    TheLord Thread Starter

    Joined:
    Jan 29, 2005
    Messages:
    98
    Hi guys,
    i'm a network admin, i would like to have a file that generates random passwords of 8 characters containing letters, digits, symbols...it should generate 100 unique passwords everytime i press the generate button.. my purpose of this is to use it for local administrator account on each pc within my company..
    i think it's possible and doable by vb developer..

    hope some one can help me out.

    Your help is much appreciated..
    thanks
     
  2. coderitr

    coderitr

    Joined:
    Oct 12, 2003
    Messages:
    3,015
    Yes it's possible. Do you want to always have the password contain upper and lower case letters AND symbols AND numbers?
     
  3. TheLord

    TheLord Thread Starter

    Joined:
    Jan 29, 2005
    Messages:
    98
    only lower case letters, and yes, it should be a mix of all, always. thnx alot for ur help..
     
  4. coderitr

    coderitr

    Joined:
    Oct 12, 2003
    Messages:
    3,015
    Where should the output be directed?
     
  5. TheLord

    TheLord Thread Starter

    Joined:
    Jan 29, 2005
    Messages:
    98
    output shud be in a text window, where i'll be able to highlight and copy the text..
    i attached an image i made, it's possible to be in this way..

    thanks

    to give u credit for it, place ur name and email address if u want..

    cheerz
     

    Attached Files:

  6. Mosaic1

    Mosaic1

    Joined:
    Aug 17, 2001
    Messages:
    7,486
    Should you also compare it to the Passwords which already exist so you don't duplicate?
     
  7. TheLord

    TheLord Thread Starter

    Joined:
    Jan 29, 2005
    Messages:
    98
    will, there shouldn't be duplicates .. thnx
     
  8. Mosaic1

    Mosaic1

    Joined:
    Aug 17, 2001
    Messages:
    7,486
    I mean dupes of already existing passwords in use.
     
  9. Rollin_Again

    Rollin_Again

    Joined:
    Sep 4, 2003
    Messages:
    4,912
    Here is a sample password generator I made. It will create a password of whatever length you choose and will include 2 numbers and letters. If you want to check for duplicate passwords, you will need to store you existing passwords in a database or excel file and check for matches against the password that is generated by the program.

    Rollin
     

    Attached Files:

  10. coderitr

    coderitr

    Joined:
    Oct 12, 2003
    Messages:
    3,015
    This program generates a random number between 1 and 3 then:

    1 = alphabetic characters
    2 = symbols
    3 = numerics

    Generates a random number to select one character from the approprriate set and repeats until it has generated an 8 character string. Then 100 passwords are generated and displayed in the list box. The program does not enforce that each password must contain at least one element from each group nor does it check for a duplicate in the list box but the laws of probablity suggest that both items will be in compliance with your requirements. The first character of each password must be alphabetic and there may be characters in the symbols that are invalid -- I haven't spent the time to test each one. I've included the source code so if there are invalid characters you may remove them.
     

    Attached Files:

  11. Rollin_Again

    Rollin_Again

    Joined:
    Sep 4, 2003
    Messages:
    4,912
    Coder,

    Is it possible for you to post your code? I don't have VB installed on my home machine and would like to see the source.

    Rollin
     
  12. coderitr

    coderitr

    Joined:
    Oct 12, 2003
    Messages:
    3,015
    Code:
    Option Explicit
    Const alphas = "abcdefghijklmnopqrstuvwxyz"
    Const symbols = "~_`[email protected]#$%^&*()+=><:;][}{"
    Const numbers = "0123456789"
    Private Sub Form_Resize()
       List1.Height = Me.ScaleHeight
       List1.Width = Me.ScaleWidth
    End Sub
    Private Sub mnuAbout_Click()
       frmAbout.Show vbModal
    End Sub
    
    Private Sub mnuExit_Click()
       Unload Me
    End Sub
    Private Function GenerateRandomStrongPassword() As String
       Dim strLocal As String
       Dim intSeed As Integer
       Dim intIndex As Integer
       Dim count As Integer
       
       strLocal = ""
       
       count = 0
       Do Until count > 7
          If count = 0 Then intSeed = 1 Else intSeed = GetRandomNumber(3)
          
          Select Case intSeed
             Case 1
                strLocal = strLocal & Mid(alphas, GetRandomNumber(Len(alphas)), 1)
             Case 2
                strLocal = strLocal & Mid(symbols, GetRandomNumber(Len(symbols)), 1)
             Case 3
                strLocal = strLocal & Mid(numbers, GetRandomNumber(Len(numbers)), 1)
          End Select
          count = count + 1
       Loop
       
       GenerateRandomStrongPassword = strLocal
    End Function
    Private Sub mnuGenerate_Click()
       Dim count As Integer
       count = 0
       List1.Clear
       
       Do Until count > 99
          List1.AddItem GenerateRandomStrongPassword
          count = count + 1
       Loop
    End Sub
    Private Function GetRandomNumber(max As Integer)
       Dim n As Long
       
       Randomize (Timer)
       Do Until n > 0 And n <= max
          n = max * Rnd
       Loop
       
       GetRandomNumber = n
    End Function
     
  13. coderitr

    coderitr

    Joined:
    Oct 12, 2003
    Messages:
    3,015
    Here's a screen shot
     

    Attached Files:

  14. TheLord

    TheLord Thread Starter

    Joined:
    Jan 29, 2005
    Messages:
    98
    rollin, i like ur idea but i hate to use it as a macro, cuz my secuirty is set to high and that's according to the policy.. if i get it as an executable it would be great ...

    coderitr , I LOVE IT !!!!! thanks very much, i really appreciate your hard work on that .. just a little addition to it, i'm unable to select multipul strings to do copy&paste..
    what shall i do ?

    thanks again, i owe u.
     
  15. coderitr

    coderitr

    Joined:
    Oct 12, 2003
    Messages:
    3,015
    You can't copy/paste froma list box. I can change it to put the password in a text biox so you'll be able to copy/paste but:

    (1) you still won't be able to select more than one
    (2) an array of 100 text boxes will make the memory resources required by this program unjustifiably large

    Let me know.
     
  16. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/325912

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice