class RandomPassword
{
    
private string randomChars = "BCDFGHJKMPQRTVWXY2346789";

    
public string GetRandomPassword(int passwordLen)
    {
        
string password = string.Empty;
        
int randomNum;
        Random random 
= new Random();
        
for (int i = 0; i < passwordLen; i++)
        {
            randomNum 
= random.Next(randomChars.Length);
            password 
+= randomChars[randomNum];
        }
        
return password;
    }
}

相关文章:

  • 2021-09-05
  • 2022-01-15
  • 2021-10-28
  • 2021-07-02
  • 2021-10-06
  • 2022-12-23
猜你喜欢
  • 2021-09-19
  • 2021-07-20
  • 2022-01-18
  • 2021-07-23
相关资源
相似解决方案