title: Random numbers for dice game
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/376344/random-string-generation-two-generated-one-after-another-give-same-results">random string generation - two generated one after another give same results</a>  </p>
  </blockquote>
  
  
  
  <p>I am writing a simple dice game for windows phone 7, that involves rolling two dice at the same time.  Here is my Dice Roll Code:</p>
  
  <pre><code> private int DiceRoll()
      {
          int result;
          Random rnd = new Random();
  
          result = rnd.Next(1, 7);
          return result;
      }
  </code></pre>
  
  <p>I then have this code that rolls the dice when a button is clicked:</p>
  
  <pre><code>   private void roll_Click(object sender, RoutedEventArgs e)
      {
          roll1 = DiceRoll();
          roll2 = DiceRoll();}
  </code></pre>
  
  <p>My problem is that both die get the same result.</p>
  
  <p>Any idea how I can get a rolling algorithm that will usually return different results, but occasionally return the same?</p>