The simplest random password generation scheme with ASP.NET is to return a portion of a GUID. A GUID is a Globally Unique ID, a 128-bit number that can be quickly generated with one method call, producing a hexidecimal string that can be used as a random password. To create a new GUID, use the System.Guid structure's NewGuid() method. Then, the .ToString() method can be used to create a string version of this. Here's some example code:
Result = System.Guid.NewGuid().ToString();
|