How do I go about producing random numbers within a range?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Generic Generics in Managed C++
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
Try below code.
Use:
You can try
Have a look at
Random Class, Random.Next Method (Int32, Int32) and Random.NextDouble Method
For future readers if you want a random number in a range use the following code:
C# Random double between min and max
Something like:
Aside from the Random Class, which generates integers and doubles, consider:
Stack Overflow question Generation of (pseudo) random constrained values of (U)Int64 and Decimal
C# RandomProvider Class