How to generate random numbers in asp.net using c#

in this we programming tutorial we will learn that how we can create random number in asp.net using c#. see the below code and just copy and paste.
Random rand = new Random((int)DateTime.Now.Ticks);
        int numIterations = 0;
        numIterations=  rand.Next(1, 100);
        Response.Write(numIterations.ToString());

Admin

A Software Engineer, Social Media Marketing Expert, writer,

1 Comments

  1. really nice and informative post thanks for sharing it. Keep up.

    ReplyDelete
Previous Post Next Post