title: Random number generator only generating one random number
body: <p>I have the following function:</p>
  
  <pre><code>//Function to get random number
  public static int RandomNumber(int min, int max)
  {
      Random random = new Random();
      return random.Next(min, max);
  }
  </code></pre>
  
  <p>How I call it:</p>
  
  <pre><code>byte[] mac = new byte[6];
  for (int x = 0; x &lt; 6; ++x)
      mac[x] = (byte)(Misc.RandomNumber((int)0xFFFF, (int)0xFFFFFF) % 256);
  </code></pre>
  
  <p>If I step that loop with the debugger during runtime I get different values (which is what I want).
  However, if I put a breakpoint two lines below that code, all members of the <code>mac</code> array have equal value.</p>
  
  <p>Why does that happen?</p>