New Unique Random Code Generator with Constant Beginning value ASP.NET/C#


Here is the exciting new Unique code generator for C# for .NET programmers. unlike the other random code generators this generator has more uniqueness even you can give some insistingly a constant value.
This code uses the default random() function and also modulus of 2 is checked and random code is generated for the given random condition. Finally the Number is converted to string and also concatenated  with the string to generate the random number.

Random uni1 = new Random();
     
        string s = "BNW";
        int uni;
        int n = 0;
        while (n < 10)
        {
            if (n % 2 == 0)
            {
                s += uni1.Next(10).ToString();

            }
            else
            {
                uni = uni1.Next(52);
                if (uni < this.characters.Length)
                    s = String.Concat(s, this.characters[unique]);
            }
            model.Text = s.ToString();
            n++;
           
        }
Hopefully it helps you. Drop your Suggestions to Comments.
Thanks g.

Share this:

ABOUT THE AUTHOR

Hello We are OddThemes, Our name came from the fact that we are UNIQUE. We specialize in designing premium looking fully customizable highly responsive blogger templates. We at OddThemes do carry a philosophy that: Nothing Is Impossible

0 comments:

Post a Comment