10-30-2012, 05:43 PM
Well, here's a quick code snippet that I crafted especially for you!
Since an integer can't hold something that is 15 characters long, we need to individually generate 15 random integers and insert them into a String. Like so,
[code2=vbnet]Dim randomNumberLength As Integer = 15
Dim randomNumberString As String = ""
For i As Integer = 1 To randomNumberLength Step 1
Randomize() 'Randomize the numberset
randomNumberString += CInt((Rnd() * 10)).ToString 'Generate a number from 0-9 and tack it onto String.
Next[/code2]
Hopefully this helps solve your problem. If you have any questions about this code, feel free to ask!
The variable randomNumberString is now your random number of randomNumberLength characters long.
Since an integer can't hold something that is 15 characters long, we need to individually generate 15 random integers and insert them into a String. Like so,
[code2=vbnet]Dim randomNumberLength As Integer = 15
Dim randomNumberString As String = ""
For i As Integer = 1 To randomNumberLength Step 1
Randomize() 'Randomize the numberset
randomNumberString += CInt((Rnd() * 10)).ToString 'Generate a number from 0-9 and tack it onto String.
Next[/code2]
Hopefully this helps solve your problem. If you have any questions about this code, feel free to ask!
The variable randomNumberString is now your random number of randomNumberLength characters long.