I want to get a number of 36 random digits in C #, use the Random but I could not make the number of digits only 36
Greetings and thanks
I want to get a number of 36 random digits in C #, use the Random but I could not make the number of digits only 36
Greetings and thanks
It occurs to me that you could name them in a String variable if you want such a long number.
Random random = new Random();
String numero="";
for(int i=0;i<36;i++){
numero += Convert.ToString(random.Next(0, 9));
}
This way you would have a random 36-digit number stored in a String variable. If what you want is to make calculations with the thing is complicated.
That I know the maximum value of Int64
according to microsof is 9.223.372.036.854.775.807
If you try to pass that number to a variable int it's basically going to give you
System.OverflowException: 'Value too large or too small for
tipo de valor
.'