Hi,
I have the following function:
//Function to get random number
{
Random random = new Random();
return random.Next(min, max);
}
I'm trying as following
byte[] mac = new byte[6];
for (int x = 0; x < 6; ++x)
mac[x] = (byte)(Misc.RandomNumber((int)0xFFFF, (int)0xFFFFFF) % 256);
If I step that loop with the debugger during run time I get different values (which is what I want). However, if I put a break point two lines below that code, all members of the "mac" array have equal value.
Please resolve my problem.
Thanks in advance.
Can you answer this question?
Write Answer1 Answers