Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Random Number

Status
Not open for further replies.

VBdevil

Programmer
Sep 19, 2002
75
IL
I want to generate a random number, in different ranges (for instance between 0-100, -100 to 100, or 0-1).

Is there a function in C# with which I can do this?
if not, then how can I do this in C#?
 
There's a class named Random, which returns a pseudo-random number. It's not very good, as it will repeat itself. If you want truly random numbers, use the RNGCryptoServiceProvider class in System.Security.Cryptography namespace.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top