Rock.Model.AttendanceCodeService.GenerateRandomNumericCode C# (CSharp) Метод

GenerateRandomNumericCode() приватный статический Метод

Generates a random (security) code containing only numeric characters.
private static GenerateRandomNumericCode ( int length ) : string
length int A representing the length that the code needs to be.
Результат string
        private static string GenerateRandomNumericCode( int length )
        {
            StringBuilder sb = new StringBuilder();

            int poolSize = numericCharacters.Length;
            for ( int i = 0; i < length; i++ )
            {
                sb.Append( numericCharacters[_random.Next( poolSize )] );
            }

            return sb.ToString();
        }