Passworg Generator

Hi

I need to be able to generate a random password, but the password must not have any repeating characters.
Anybody able to assist please?

@gary.cobden,

You can follow this logic:

  1. Define Character Set: Decide on the character set you want to use for the password (e.g., lowercase letters, uppercase letters, numbers, symbols).
  2. Generate Password: Use a randomization method to create a password of the desired length.
  3. Check for Repeating Characters: After generating each character, check if it has already been used in the password. If it has, regenerate that character until it’s unique.
  4. Repeat until Desired Length: Repeat the process until the password reaches the desired length.

Generated by LLM but validated by expert.

Thanks,
Ashok :slight_smile:

A sample VB .NET Password Generator from internet.
Use it in InvokeCode.
Cheers

Dim s As String = "ABCDEFGHIJKLMNOPQRSTUVWXYZ?!@#$%*-+0123456789abcdefghijklmnopqrstuvwxyz" 
Dim r As New Random
Const passwordLength As Integer = 9
Dim passwordChars() As Char = New Char(passwordLength - 1) {}
Dim charIndex As Integer

For i As Integer = 0 To passwordLength - 1
  charIndex = r.Next(s.Length)
  passwordChars(i) = s(charIndex)
  s = s.Remove(charIndex,1) 'remove character already used in pwd
Next

Dim password As New String(passwordChars)

Hi @gary.cobden

Check the below thread. This will help you create Random passwords.

Regards