How to Choose Random number from given list of numbers in VB.Net
问题 I want to create a random number generator in VB.NET But from my own given list of numbers Like Chose random numbers from [1,2,3,4,5,6] e.t.c 回答1: This is how you get a random natural number in the interval of [0, n - 1]: CInt(Rnd() * n) Let's suppose you have a List of n elements. This is how you get a random element from it: MyList(CInt(Rnd() * n)) 回答2: Already built into .NET base of 'Random' and then extending that into your existing choices. This is NOT the same as generating the number