How can I generate random numbers (int) in C#.NET?
Answer hi here is my simple method generate random password for you can remove alphabet from this int num = random.Next(1000); does this here is another one more detail public static string GetRandomPassword(int numChars, int seed) { string[] chars = { “A”, “B”, “C”, “D”, “E”, “F”, “G”, “H”, “I”, “J”, “K”, “L”, “M”, “N”, “P”, “Q”, “R”, “S”, “T”, “U”, “V”, “W”, “X”, “Y”, “Z”, “2”, “3”, “4”, “5”, “6”, “7”, “8”, “9” }; Random rnd = new Random(seed); string random = string.Empty; for (int i = 0; i < numChars; i++) { random += chars[rnd.Next(0, 33)]; } return random; } Happy Programming!!