Skip to content

How can I create a random c# code

Ibrahim Mohammed

Asked Jul 14, 2015, 5:04 PM EDT1 answer
Share
LinkedInX
 

Hello,

 

I want a Windows Phone Silverlight 8.1 code does when you press the button opens the next page randomly (from between the pages in the app) ??

thanks

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • Kashyap Diwan
    0

    The following code returns a random number:

    int num = random.Next();

    The following code returns a random number less than 100.

    int num = random.Next(100);

    The following code returns a random number between min and max:

    Python
    private int RandomNumber(int min, int max)
    {
    Random random = new Random();
    return random.Next(min, max);
    }
    0