title: Creating a true random
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/932520/why-does-it-appear-that-my-random-number-generator-isnt-random-in-c">Why does it appear that my random number generator isn&#39;t random in C#?</a><br>
    <a href="https://stackoverflow.com/questions/1234094/how-can-i-generate-truly-not-pseudo-random-numbers-with-c">How can I generate truly (not pseudo) random numbers with C#?</a>  </p>
  </blockquote>
  
  
  
  <p>I've created a dice game where the dice is based on a percentile, 1-100.</p>
  
  <pre><code>public static void Roll()
  {
      Random rand = new Random((int)DateTime.Now.Ticks);
      return rand.Next(1, 100);
  }
  </code></pre>
  
  <p>But I don't feel like it's a real random based on current time.</p>
  
  <p>If I do </p>
  
  <pre><code>for (int i = 0; i &lt; 5; i++)
  {
     Console.WriteLine("#" + i + " " + Roll());
  }
  </code></pre>
  
  <p>They would all be the same values, because the <code>DateTime.Now.Ticks</code> didn't change, it seeded the same number.</p>
  
  <p>I was thinking I could generate a new random seed if the seed was the same due to the current time, but it doesn't feel like an honest "re-roll"</p>
  
  <p>What should I do to try and replicate a close to real/honest dice roll?  Should I use the <code>RNGCryptoServiceProvider</code> class to generate rolls instead?</p>