Each byte in the array is assigned to a random number in range for the type. The NextBytes method on the Random type enables you to get random values of arbitrary length.,Example., This program shows the NextBytes method on the Random type and uses it to acquire a random array of bytes.