Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Actual Random number generation
I would like to generate a random number.
Currently im using the folowing:
private void GeraPadraoProjetado()
int seed = 2; //chosen randomly by me
Random fixRand = new Random(seed);
PadraoProjetado[i] = (int)(256*fixRand.NextDouble());
As I have observed, the generated numbers are always the same each time I execute the program.
When I programed in Visual Basic, I remember we had to use the "Randomize()" function before using the function that generated the random numbers in order to essure that the numbers would be actualy random.
Does anyone know what to do in C#?
Thanks in advance!]
Ps.: Excuse me about the code indentation, I simply didnt know how to do it here.
0 · ·