Sometimes developers need to generate random numbers, so Microsoft has included a builtin class in the C# language.For generating a random number, you can use the Random class in C# that resides in the "System" Namespace.Step 1: Create a new Empty Website named "Website1".And add the Web form named "Deafult.aspx" into it.Step 2: Add a button to the "Deafult.aspx" page with the Text "Generate Random Number" and a click event.Step 3: Write the code on button click event.
Step 4: After running the page.After clicking the button, first I got "369593053" as the random number.And the second time, I got "820031117" as the random number.Note: You can also set the range of random numbers. In my future article you can see that.
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: