// Random Password Generation
VB.NET
Randomize()
whatsNext = Int((1 - 0 + 1) * Rnd() + 0)
strNewPass = strNewPass & Chr(Int((upper - lower + 1) * Rnd() + lower))
The above two lines are in visual basic.net. I have converted the above lines to C#.NET. It is given below.
C#.NET
Random RandomGenerator = new Random(20);
whatsNext = (int)((1 - 0 + 1) * RandomGenerator.Next() + 0);
strNewPass = strNewPass + (char)((int)((upper - lower + 1) * RandomGenerator.Next() + lower));
I have tried the same code executing in VB.NET, it is working fine. somehow I couldn't get the same result when I have tried in C#.NET.
Is there anything wrong?
If anyone know the solution, let me know.
Thanks in Advance.
VB.NET
Randomize()
whatsNext = Int((1 - 0 + 1) * Rnd() + 0)
strNewPass = strNewPass & Chr(Int((upper - lower + 1) * Rnd() + lower))
The above two lines are in visual basic.net. I have converted the above lines to C#.NET. It is given below.
C#.NET
Random RandomGenerator = new Random(20);
whatsNext = (int)((1 - 0 + 1) * RandomGenerator.Next() + 0);
strNewPass = strNewPass + (char)((int)((upper - lower + 1) * RandomGenerator.Next() + lower));
I have tried the same code executing in VB.NET, it is working fine. somehow I couldn't get the same result when I have tried in C#.NET.
Is there anything wrong?
If anyone know the solution, let me know.
Thanks in Advance.