Trying to generate password from text

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • CJ Densmore
    New Member
    • Dec 2010
    • 4

    Trying to generate password from text

    I am trying to create a tool for work that allows you to enter a 5-7 digit string (can be numbers or letters) and I want to replace the strings with other differt letters and numbers, and reverse the order after click. I am aware of the .replace method but am having a little trouble negoting the syntax... heres an example...

    I will enter "AUI65" and I want the program to return x for a or u, z for any integer, and reverse the order the string "zzxxx" insted of "xxxzz"... can someone point me in the right direction? I am trying to learn VB on my own so it is challenging! Thank you!
  • Rodney Roe
    New Member
    • Oct 2010
    • 61

    #2
    you can do something like this:
    Code:
    Sub TEST()
    Dim myVal1, myvalRev As String
    
    myVal1 = "Rodney"
    myvalRev = StrReverse(Replace(Replace(myVal1, "o", "1"), "d", "9"))
    End Sub\
    StrReverse is the function you are looking for. You can also stack as many replaces as you need as well, I beleive, I haven't tried more than four, but it should work.

    Have fun

    Comment

    • Guido Geurs
      Recognized Expert Contributor
      • Oct 2009
      • 767

      #3
      You can use the Property "PasswordCh ar" for a textbox.
      All the text in the textbox will be replaced (only for the eye) with the Char of the property.

      If You want the letters and numbers be seen as different chars, than you must program it.

      Please let me know if the first is sufficient or if You want help with the code?

      Comment

      Working...