//************************************** // Name: random password // Description:generating random password // By: hatem mostafa ahmed // // // Inputs:None // // Returns:None // //Assumes:None // //Side Effects:None //************************************** using System; public class Program { public static void Main() { Console.WriteLine("Hello World"); var rd= new Random(); int a = rd.Next(1,8);//create a random number between 1 and 8 Console.WriteLine(a); int b= rd.Next(97,122);// create ascci code Console.WriteLine((char)b);// cast ascci code to char char[] buffer = new char[10]; for(int i=0;i<10;i++) buffer[i]=(char)('a'+rd.Next(0,26)); String password = new String(buffer); Console.WriteLine(password);//generate pawword random of char } }