Forum Discussion

anatar02's avatar
anatar02
Contributor
13 years ago

How to generate unique numbers by using C#

Hi All,



I am new to C# and needs to generate some 1 to 8 digit numbers but I could not get it done with knowledge of C#, So someone can you please help me to generate a unique number by using C#.


3 Replies

  • Hi,


    The following C#Script function generates a random number within a given interval:

    function randInt(min, max)

    {

      return Math["round"](Math["random"]()*(max-min)+min)

    }

  • Thanks it works.



    Could you please help me to generate the unique number.