Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Generate Password

public string CreatePassword(int length)
{
  const string valid = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890<>.,/@#$%^&*()_+!:";
  StringBuilder res = new StringBuilder();
  Random rnd = new Random();
  while (0 < length--)
  {
    res.Append(valid[rnd.Next(valid.Length)]);
  }
  return res.ToString();
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Generate #Password
ADD COMMENT
Topic
Name
1+7 =