title: Unique 4 digit random number in C#
body: <p>I want to generate an unique 4 digit random number. This is the below code what I have tried:</p>
  
  <p><strong>Code for generating random number</strong></p>
  
  <pre><code>//Generate RandomNo
  public int GenerateRandomNo()
  {
      int _min = 0000;
      int _max = 9999;
      Random _rdm = new Random();
      return _rdm.Next(_min, _max);
  }
  </code></pre>
  
  <p>The problem is I have received a random no with value <code>241</code> which is not a 4 digit number. Is there any problems with the code?</p>