filling a array with random numbers between 0-9 in c#
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/10688044/filling-a-array-with-uniqe-random-numbers-between-0-9-in-c-sharp">filling a array with uniqe random numbers between 0-9 in c#</a>  </p>
</blockquote>



<p>I have a array like "page[100]" and i want to fill it with random numbers between 0-9 in c#...
how i can do this?
i used :</p>

<pre><code>IEnumerable&lt;int&gt; UniqueRandom(int minInclusive, int maxInclusive)
{
    List&lt;int&gt; candidates = new List&lt;int&gt;();
    for (int i = minInclusive; i &lt;= maxInclusive; i++)
    {
        candidates.Add(i);
    }
    Random rnd = new Random();
    while (candidates.Count &gt; 1)
    {
        int index = rnd.Next(candidates.Count);
        yield return candidates[index];
        candidates.RemoveAt(index);
    }
}
</code></pre>

<p>this way :</p>

<pre><code>int[] page = UniqueRandom(0,9).Take(array size).ToArray();
</code></pre>

<p>but it just gave me 9 unique random numbers but i need more.
how i can have a array with random numbers that are not all the same?</p>
