Skip to content

Instantly share code, notes, and snippets.

@priore
Created October 25, 2013 23:54
Show Gist options
  • Save priore/7163627 to your computer and use it in GitHub Desktop.
Save priore/7163627 to your computer and use it in GitHub Desktop.
Generate random password from GUID
// generate random password from GUID
string password = string.Empty;
string guid = Guid.NewGuid().ToString().Replace("-", string.Empty);
Random random = new Random(DateTime.Now.Millisecond);
for (int i = 0; i < 8; i++)
password += guid.Substring(random.Next(0, guid.Length - 1), 1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment