46+ C Sharp Password Generator Examples

This post contains a total of 46+ Hand-Picked C Sharp Password Generator Examples. All the Password Generators are made purely using C Sharp Programming language.

You can use the source codes of these C# password generators for educational use with the credits to the owner, if you want to modify the code and use it for something else then you can contact the original owner for it.

Related Posts

Click a Code to Copy it, and Hover over a video to play it.

1. By Sololearn

A basic C Sharp password generator by Sololearn. It generates a random password that is 8 digits in length. ( Source )

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace SoloLearn
{
	class Program
	{
	    static string generatePswd(int length)
        {
            const string validChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
            StringBuilder res = new StringBuilder();
            Random rnd = new Random();
            while (0 < length--)
            {
                res.Append(validChars[rnd.Next(validChars.Length)]);
            }
            return res.ToString();
        }
        
		static void Main(string[] args)
		{
		    //password length
		    int length = 8;
		    
			string pass = generatePswd(length);
			Console.Write(pass);
		}
	}
}

2. By Sau_rab_h

Made by Sau_rab_h. The program generates a random 10 digit password. ( Source )


using System;  
using System.Text;  
  
class RandomNumberSample  
{  
    static void Main(string[] args)  
    {  
        
        Random random = new Random();  
        
        int num = random.Next();  
        int randomLessThan100 = random.Next(100);  
        int randomBetween100And500 = random.Next(100, 500);  
        
        RandomNumberGenerator generator = new RandomNumberGenerator();  
        int rand = generator.RandomNumber(5, 100);  
        
        string str = generator.RandomString(10, false);  
        string pass = generator.RandomPassword();  
        Console.WriteLine($"Random password is {pass}\n\n_________________________________________________\n\nGuys!! this is a simple csharp code for random password generation...hope u guys like it and will give a (+1)upvote \n\n_________________________________________________ ");  
  
        Console.ReadKey();  
    }  
}  
  
public class RandomNumberGenerator  
{  
     
    public int RandomNumber(int min, int max)  
    {  
        Random random = new Random();  
        return random.Next(min, max);  
    }  
public string RandomString(int size, bool lowerCase)  
{  
    StringBuilder builder = new StringBuilder();  
    Random random = new Random();  
    char ch;  
    for (int i = 0; i < size; i++)  
    {  
        ch = Convert.ToChar(Convert.ToInt32(Math.Floor(26 * random.NextDouble() + 65)));  
        builder.Append(ch);  
    }  
    if (lowerCase)  
        return builder.ToString().ToLower();  
    return builder.ToString();  
}  
  
    public string RandomPassword(int size = 0)  
    {  
        StringBuilder builder = new StringBuilder();  
        builder.Append(RandomString(4, true));  
        builder.Append(RandomNumber(1000, 9999));  
        builder.Append(RandomString(2, false));  
        return builder.ToString();  
    }  
}  

3. By Aterragon

Made by Aterragon. Enter the password length for a random password which contains numbers and alphabets. ( Source )

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace PasswordGenerator
{
    class Program
    {
        static void Main(string[] args)
        {
           
           Random Ale = new Random();
           Random Ale1 = new Random();
           Random Ale2 = new Random();
           Random Ale3 = new Random();
           Console.Write("Password:");
           
           /*Insert password Length*/
           int d = Convert.ToInt32(Console.ReadLine());
        
           for(int con = 1;con<=d;con++)
           {
               char r = (char)Ale.Next('A','Z'); 
               char r1 = (char)Ale1.Next('a','z');
               int r2 = Ale2.Next(0,10);
               int r3 = Ale3.Next(1,4);
               
               switch(r3)
               {
                 case 1:
                 Console.Write("{0}",r);
                 break;
                 
                 case 2:
                 Console.Write("{0}",r1);
                 break;
                 
                 case 3:
                 Console.Write("{0}",r2);
                 break;
                 
                }
               
             }
           
        }
    }
}

4. By DenisCruel

Made by DenisCruel. Enter password length to generate a random password with symbols, ASCII symbols, numbers and alphabets. ( Source )

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace SoloLearn
{
    class Program
    {
        static void Main(string[] args)
        {
            Random rand = new Random();
            int size; //size of password
            string password;
            // Array of ASCII symbols
            char [] symbols = new char [94];
            // Write symbols in array
            for(int x=0;x<94;x++){
               symbols [x] = (char)(x+33);
            }
            Console.Write("Size of password: ");
            size = int.Parse(Console.ReadLine());
            
            char[] passArr = new char[size];
            
            // Creating password
            for(int y=0;y<size;y++){
                int num = rand.Next(0,symbols.Length);
                passArr[y] = symbols [num];
            }
            password = new string(passArr );
            Console.WriteLine(password);
        }
    }
}

5. By Romain Delorme

Made by Romain Delorme. Generates a random password with symbols, numbers and alphabets, need to enter password length at first. ( Source )

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace SoloLearn
{
    class Program
    {
        static void Main(string[] args)
        {
            Random rnd = new Random();
            char[] chars= {'a','z','e','r','t','y','u','i','o','p','q','s','d','f','g','h','j','k','l','m','w','x','c','v','b','n','1','2','3','4','5','6','7','8','9','0','*',':','/','!','?','+','%','=','(',')','.',',','_','-','$','{','}','[',']','"','#','<','>',';','`','&','@','^','~','|'};
            int limit= Convert.ToInt32(Console.ReadLine());
            for(int y=0;y<limit;y++){
            int x = rnd.Next(chars.Length);
            Console.Write(chars[x]);
            }
        }
    }
}

6. By Apeiron04

Made by Apeiron04. Enter password length to generate a random password that contains numbers and alphabets. ( Source )


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace SoloLearn
{
	class Program
	{
		
		static void  PassGener(int len) {
			string UperCase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
			string LowerCase = "abcdefghijklmnopqrstuvwxyz";
			string Nums = "0123456789";
			Random rnd = new Random();
			string passgener = UperCase + LowerCase + Nums;
			Console.WriteLine("your new password:");
			for (int i =0; i < len; i++)
			{
			  
			   Console.Write ( passgener[rnd.Next(passgener.Length)]); 

			}
		   
		}
		static void Main(string[] args)
		{
			int len = 0;
			len = Convert.ToInt32(Console.ReadLine());
			PassGener(len);
			
		}
	}
}

7. By Magnesium

C sharp password generator by Magnesium. ( Source )

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace SoloLearn
{
    class Program
    {
        static void Main(string[] args)
        {
            try
        	{
           string str = "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM0123456789_";
           var rnd = new Random();
           int len = Convert.ToInt32(Console.ReadLine());
          	for (int i = 0; i < len; i++)
          	{
           Console.Write(str[rnd.Next(0, str.Length)]);
          	}
           Console.WriteLine();
        	}
        	catch (Exception e)
        	{
        	Console.WriteLine(e.Message);
        	}
        }
    }
}

8. By Konstantin Khitrykh

Made by Konstantin Khitrykh. First enter the password length you want to generate a random password with numbers, alphabets and symbols. ( Source )

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace SoloLearn {
    class Program {
        static string Input = "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz0123456789<>{}[]_|%[email protected]#$/^&*(?)]}";
        static char[] CharArray;
        static Random Rnd;
        
        static char GetRandomChar() {
            return CharArray[Rnd.Next(CharArray.Length)];
        }
        
        static string GetPassword(int len) {
           if ( CharArray == null ) {
              CharArray = Input.ToCharArray();
           }
           var seed = DateTime.Now.Millisecond;
           Rnd = new Random(seed);
           var sb = new StringBuilder();
           for( int i = 0; i < len; i++ ){
              sb.Append(GetRandomChar());
           }
           return sb.ToString();
        }
    
        static void Main(string[] args) {
            var lenStr = Console.ReadLine();
            var len = 8;
            if ( lenStr.Length > 0 ) {
               int.TryParse(lenStr, out len);
            }
            var pass = GetPassword(len);
            Console.WriteLine("New password:\n " + pass);
        }
    }
}

9. By Adrian Grill

Made by Adrian Grill. Enter a password length between 4 – 25 to generate a random password. ( Source )

/*
 *
 * Written by Adrian Grill,
 * 24.02.2019 in Katowice, Poland
 *
 */

using System;
using static System.Console;

namespace PasswordGenerator
{
    class Central
    {
        private static void Main()
        {
            Random random = new Random();
            string passwordLengthString = default(string);
            int passwordLengthInt = default(int);
            bool converted = false;
            string generatedPassword = default(string);
            
            passwordLengthString = ReadLine();
            
            converted = Int32.TryParse(passwordLengthString, out passwordLengthInt);
            
            if (
                (!converted) || 
                (passwordLengthInt > 25) || 
                (passwordLengthInt < 4)
            )
            {
                WriteLine($"You entered : [{passwordLengthString}], length of the password must be an int number ranging from 4 to 25");
                Environment.Exit(0);
            }
            else 
            {
                for (int i = 0; i < passwordLengthInt; i++)
                {
                    int temporaryRandomNumber = random.Next(33, 127);
                    generatedPassword += ((char)(temporaryRandomNumber)).ToString();
                }
                
                WriteLine($"Your password is : {generatedPassword}");
                
                Environment.Exit(0);
            }
        }
    }
}

10. By Aliendbet

Made by Aliendbet. Enter password length between 8 – 32 for a random password. ( Source )

using System;
using System.Text;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            Int16 x;
            x = Convert.ToInt16( Console.ReadLine());
            if ( x <= 32 && x >= 8)
            {
                StringBuilder randomText = new StringBuilder();
                string alphabets = "[email protected]#$%^&*()_+";
                Random r = new Random();
                for (int j = 0; j <= x; j++)
                {
                    randomText.Append(alphabets[r.Next(alphabets.Length)]);
                }
                Console.WriteLine(randomText);
                Console.Read();
            }
        }
    }
}

11. By Boyd

Basic C Sharp password generator by Boyd. Generates a random 8 digit password. ( Source )

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace SoloLearn
{
    class Program
    {
        static void Main(string[] args)
        {
            Random rnd = new Random();
            string _Set = "QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopsdfghjklzxcvbnm1234567890";
            for (int c = 0; c < 8; c++){
               int _Rand = rnd.Next(0, _Set.Length);
               Console.Write(_Set[_Rand]);
            }
        }
    }
}

12. By Ollie Q

Made by Ollie Q. Enter password length for a random password, the password length limit is set to 33 digits. ( Source )

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
//"[email protected]#$%^&*_=+-/€.?<>)";
namespace SoloLearn
{
	class Program
	{
	public void Password() {
		
}
	//return sentence.ToString();
	
		static void Main(string[] args)
		{
		
			int characters = Convert.ToInt32(Console.ReadLine());

if(characters <= 7){
	characters = 8;
} 
else if(characters >= 33){
	characters = 32;
	
}
		
		int min = 0;
		string sentence = "";
		int max1 = 52;
		int max2 = 10;
		int max3 = 19;
		Random rnd = new Random();
		
		

		List<string> letters = new List<string>(new string[] { "a", "A", "b", "B", "c", "C", "d", "D", "e", "E", "f", "F", "g", "G", "h", "H", "i", "I", "k", "K", "j", "J", "l", "L", "m", "M", "n", "N", "o", "O", "p", "P", "q", "Q", "r", "R", "s", "S", "t", "T", "u", "U", "v", "V", "w", "W", "x", "X", "y", "Y", "z", "Z"} );
List<string> numbers = new List<string>(new string[] {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"});
List<string> Characters = new List<string>(new string[] {"!", "@", "#", "$", "%", "^", "*", "_", "&", "=", "+", "-", "/", "€", ".", "?", " >", "<"});
int charc = 0;

string l;

while(charc <= characters){
charc++;
int num = rnd.Next(1, 4);

switch(num) {
case 1:
int pick1 = rnd.Next(min, max1);
l = letters[pick1];
sentence += l;
break;

case 2:
int pick2 = rnd.Next(min, max2);
l = numbers[pick2];
sentence += l;
break;

case 3:
		int pick3 = rnd.Next(min, max3);
l = Characters[pick3];
sentence += l;
break;

}

}
Console.Write("your password is: " + sentence);

		}
	}
}

13. By Yhal Htet Aung

Made by Yhal Htet Aung. Generates a random 16 digits password that contains symbols, alphabets and numbers. ( Source )

/// <summary>
/// Creator: Yhal Htet Aung
/// Website: www.yhalhtet.com
/// Date: March 31, 2017
/// </summary>

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace SoloLearn
{
    
    /// <summary>
    /// This class accepts the password's length paramether and
    /// generates the password based on parameter.
    /// </summary>
    public class Password
    {
        /// <summary> The length property sets the value of the length of Password class. </summary>
        private int length = 0;
        
        /// <value> The construction property 'l' and validates to get value more than 0. </value>
        public Password(int l) 
        {
            if (l <= 0) 
            {
                this.length = 0;
            }
            else 
            {
                length = l;
            }
        }
        
        /// <summary> This method generates the password based on the length. </summary>
        public void GeneratePassword() 
        {            
            const string chars = "a[email protected]#$%^&*()_+-=";
            StringBuilder sb = new StringBuilder();
            Random rnd = new Random();
            while (0 < length--)
            {
                sb.Append(chars[rnd.Next(chars.Length)]);
            }
            
            PrintPassword(sb);
        }
        
        /// <summary> This method prints out the StringBuilder's value. </summary>
        private static void PrintPassword(StringBuilder sb) 
        {
            Console.WriteLine(sb.ToString());            
        }
    }
    
	class Program
	{
		static void Main(string[] args)
		{
		    /// <summary> The value '16' passed into password object as parameter. </summary>
		    Password password = new Password(16);
            password.GeneratePassword();
		}
	}
}

14. By peace 111

Made by peace 111. Generates a random 5 digits password with numbers, alphabets and symbols. ( Source )

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;

namespace password_generator
{
      class Program
    {
        public static int rannum;

        public static int rannum1;

        public static int num = 0;


         public static void Main(string [] args)
        {

            char[] colarr = new char[85];
            colarr[0] = '0';
            colarr[1] = '1';
            colarr[2] = '2';
            colarr[3] = '3';
            colarr[4] = '4';
            colarr[5] = '5';
            colarr[6] = '6';
            colarr[7] = '7';
            colarr[8] = '8';
            colarr[9] = '9';
            colarr[10] = 'a';
            colarr[11] = 'b';
            colarr[12] = 'c';
            colarr[13] = 'd';
            colarr[14] = 'e';
            colarr[15] = 'f';
            colarr[16] = 'g';
            colarr[17] = 'h';
            colarr[18] = 'i';
            colarr[19] = 'j';
            colarr[20] = 'k';
            colarr[21] = 'l';
            colarr[22] = 'm';
            colarr[23] = 'n';
            colarr[24] = 'o';
            colarr[25] = 'p';
            colarr[26] = 'q';
            colarr[27] = 'r';
            colarr[28] = 's';
            colarr[29] = 't';
            colarr[30] = 'u';
            colarr[31] = 'v';
            colarr[32] = 'w';
            colarr[33] = 'x';
            colarr[34] = 'y';
            colarr[35] = 'z';
            colarr[36] = 'A';
            colarr[37] = 'B';
            colarr[38] = 'C';
            colarr[39] = 'D';
            colarr[40] = 'E';
            colarr[41] = 'F';
            colarr[42] = 'G';
            colarr[43] = 'H';
            colarr[44] = 'J';
            colarr[45] = 'K';
            colarr[46] = 'L';
            colarr[47] = 'M';
            colarr[48] = 'N';
            colarr[49] = 'O';
            colarr[50] = 'P';
            colarr[51] = 'Q';
            colarr[52] = 'R';
            colarr[53] = 'S';
            colarr[54] = 'T';
            colarr[55] = 'U';
            colarr[56] = 'V';
            colarr[57] = 'W';
            colarr[58] = 'X';
            colarr[59] = 'Y';
            colarr[60] = 'Z';
            colarr[61] = '+';
            colarr[62] = '-';
            colarr[63] = '/';
            colarr[64] = '*';
            colarr[65] = ':';
            colarr[66] = ';';
            colarr[67] = '"';
            colarr[68] = '%';
            colarr[69] = '$';
            colarr[70] = '#';
            colarr[71] = 'β„–';
            colarr[72] = '&';
            colarr[73] = '[';
            colarr[74] = ']';
            colarr[75] = '{';
            colarr[76] = '}';
            colarr[77] = '(';
            colarr[78] = ')';
            colarr[79] = '@';
            colarr[80] = '?';
            colarr[81] = '.';
            colarr[82] = ',';
            colarr[83] = '!';
            colarr[84] = '_';
            
            

                func3(colarr);
                
            
            
        }
       public static void func2(char [] colarr)
        {
            Console.Write(colarr[rannum]);
            Random rand1 = new Random();
            rannum = rand1.Next(0, 84);
            Random rand2 = new Random();
            rannum1 = rand2.Next(8, 15);
            Thread.Sleep(100);
        }
       public static void func3(char [] colarr)
        {

            func2(colarr);
            switch (rannum1)
            {
                
                case 8:
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    break;
                case 9:
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    break;
                case 10:
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    break;
                case 11:
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    break;
                case 12:
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    
                    break;
                case 13:
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    break;
                case 14:
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);

                    break;
                case 15:
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    func2(colarr);
                    break;
            }
            

        }
    }
}

15. By Flustraizen NT

Made by Flustraizen NT. Enter password length that’s between 8 – 32 digits in length. ( Source )

using System;
using System.Linq;
//Given the password length as input, create a program that will generate a random password by using a set of characters.
//The length must be between 8 and 32 characters.
namespace PasswordGenerate
{
    class Program
    {
        public static int PassLenInput = Convert.ToInt32(Console.ReadLine());
        
        public static string Password;
        
        public static string GeneratePass()
        {
            var allAscii = Enumerable.Range(33, 97).ToArray();
            for (int i = 0; i < PassLenInput; i++)
            {
                Random Rnd = new Random();
                int Rand = Rnd.Next(1, 97);
                Password += Convert.ToChar(allAscii[Rand]);
            }
            return Password;
        }

        static void Main(string[] args)
        {
            GeneratePass();
            Console.WriteLine(Password);
            Console.ReadKey();
        }
    }
}

16. By Dwight

Made by Dwight. Enter password length between 8 – 32 to generate a random password that contains hyphen in between every four letters. ( Source )


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Security.Cryptography;

namespace SoloLearn
{

   class MainClass {
  public static int ModuloLimit(int modulo) => 256 - (256 % modulo);

  public static void Main (string[] args) {
	string length= "";
	int eXit=0;
	int pwLength=0;
	bool isConvertible = false;   //check input for numbers
	int pass= 0;

	char[] password;  // actual password
  
	
	do
	{
	  Console.WriteLine ("Enter the length (8-32) of the password you would like generated: ");
	length=Console.ReadLine();
	isConvertible = int.TryParse(length, out pwLength);
	if(isConvertible==true)
   {
	  pwLength=Convert.ToInt32(length);
   } else
   {
	 Console.WriteLine($"{length} is not a valid input. Please try again.");
	 Console.WriteLine("");
   }
	if(pwLength==0)
	  {
		
	  }
	  else if (pwLength<8 || pwLength >32)
	  {
		Console.WriteLine($"{pwLength} is an invalid length. Please try again.");
	  }
	  else
	  {
		 eXit++;
	  }
	} while(eXit<1);
	int [] pwLevelOne= new int[pwLength];
	password= new char [pwLength];
	pwLevelOne= GeneratorFirstLayer(pwLength);
	password= CreatePassword(pwLevelOne, pwLength);
password=Caps(password);
	Console.WriteLine("");
	Console.WriteLine("Your password is:");
	foreach (var letterz in password)
	 {
	  if (pass== 0)
	  {
		  Console.Write($"{letterz}");
		  pass++;
	  }
	  else if(pass % 4==0)
	  {
		Console.Write($"-{letterz}");
		pass++;
	  }
	  else
	  {
		Console.Write($"{letterz}");
		pass++;
	  }
	 }


  }
  public static int[] GeneratorFirstLayer(int pwLength)
  {
	int [] pwLevelOneTemp= new int[pwLength];
	int number= 0;
	int numDigits=1;
	for (int j= 0; j< pwLength; j++)
	{
	  string a= RandomNumber(numDigits);//convert to int
	  number=Convert.ToInt32(a);
	  pwLevelOneTemp[j]= number;
	}
	return pwLevelOneTemp;
  }

  public static string RandomNumber(int numDigits)
{
	var sb = new StringBuilder(numDigits);
	for (int i = 0; i < numDigits; i++)
	{
		sb.Append(RandomDigit());
	}
	return sb.ToString();
}

public static int RandomDigit(int goes = 4, int lower = 1, int upper = 43)
{
	var bytes = new byte[goes];
	using (var random = new RNGCryptoServiceProvider())
	{
		random.GetBytes(bytes);
	}
	return LimitDigit(bytes, lower, upper);
}

public static int LimitDigit(byte[] bytes, int lower, int upper)
{
	var result = -1;
	var modulo = upper - lower;
	var upperLimit = ModuloLimit(modulo);

	for (int i = 0; i < bytes.Length; i++)
	{
		if (bytes[i] < upperLimit)
		{
			result = bytes[i] % modulo + lower;
		}
	}

	if (result == -1)
	{
		result = bytes[bytes[0] % bytes.Length] % modulo + lower;
	}

	return result;
}

  public static char[] CreatePassword(int [] pwLevelOne, int pwLength)
  {
	char[] password= new char [pwLength];
	int convert= 0;
	char[] letters= new char [43] {'1','2','3','4','5', '6', '7', '8', '9','0', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i','j', 'k', 'l', 'm','n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '!','@', '#', '$','%',  '&', '?',};
	/*char [] specials= new char [] {'!','@', '#', '$','%', '^', '&', '*', '?','=', '+', '<', '>'};*/
	for(int k=0; k< pwLevelOne.Length; k++)
	{
	  convert= pwLevelOne[k];
	  password[k]= letters[convert];
	}
	return password;
  }

public static char[] Caps(char[] password)
{
	int selector= 0;
	int limit= 0;
	Random rand= new Random();
	limit= rand.Next(1,password.Length/4);
	for (int m= 0; m<= limit; m++)
	{
	selector=rand.Next(0,password.Length);
	if (password[selector]==Char.ToUpper(password[selector]))
{
	do
	{
	selector=rand.Next(0,password.Length);  
	}while (password[selector]==Char.ToUpper(password[selector]));
}
		password[selector]=Char.ToUpper(password[selector]);
	}
	return password;
}
}

}

17. By Zachary Burkholder

Basic C Sharp password generator by Zachary Burkholder. The program generates a random 6 digits password that contains only numbers. ( Source )

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SoloLearn
{
	class Program
	{
		static void Main(string[] args)
		{
		int min = 100000;
		int max = 999999;
		
		Random rnd = new Random();
		Console.Write(rnd.Next(min, max));
			
		}
	}
}

18. By Klaid Begeja

Made by Klaid Begeja. Generates a random 8 digits password that contains symbols, numbers and alphabets. ( Source )

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Security.Cryptography;


namespace GetPassword
{
    class Program
    {
        public static string GeneratePassword(int length, int complexity)

{

RNGCryptoServiceProvider csp = new RNGCryptoServiceProvider();

/* Define the possible character classes where complexity defines the number of classes to include in the final output.
*/
char[][] classes =

{

@"abcdefghijklmnopqrstuvwxyz".ToCharArray(),
@"ABCDEFGHIJKLMNOPQRSTUVWXYZ".ToCharArray(),
@"0123456789".ToCharArray(),
@" !""#$%&'()*+,./:;<>[email protected][\]^_{|}~".ToCharArray(),

};

complexity = Math.Max(1, Math.Min(classes.Length, complexity));

if(length < complexity)

throw new ArgumentOutOfRangeException("length");

/* Since we are taking a random number 0-255 and modulo that by the number of characters, characters that appear earilier in this array will recieve a heavier weight. To counter this we will then reorder the array randomly.
This should prevent any specific character class from recieving a priority ased on it's order. 
*/

char[] allchars = classes.Take(complexity).SelectMany(c => c).ToArray();

byte[] bytes = new byte[allchars.Length];

csp.GetBytes(bytes);

for (int i = 0; i < allchars.Length; i++)

{

char tmp = allchars[i];

allchars[i] = allchars[bytes[i]%allchars.Length];

allchars[bytes[i]%allchars.Length] = tmp;

}

Array.Resize(ref bytes, length);

char[] result = new char[length];

 do 
{

csp.GetBytes(bytes);

for (int i = 0; i < length; i++)

result[i] = allchars[bytes[i]%allchars.Length];

if (Char.IsWhiteSpace(result[0]) || Char.IsWhiteSpace(result[(length - 1) % length]))

continue;

string testResult = new string(result);

if (0 != classes.Take(complexity).Count(c => testResult.IndexOfAny(c) < 0))

continue;

return testResult;

} while(true);

}
        
        static void Main(string[] args)
        {
            Console.Write("Your password is:" + GeneratePassword (8,8));
        }
    }
}

19. By Amirhosein Bagherie

Made by Amirhosein Bagherie. Generates a random 4 digit password that contains only numbers. ( Source )

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace SoloLearn
{
    class Program
    {
        static void Main(string[] args)
        {
            Random RND = new Random ();
            Console.WriteLine(RND.Next(0, 9)+""+RND.Next(0, 9)+""+RND.Next(0, 9)+""+RND.Next(0, 9));
        }
    }
}

20. By Kirion

Made by Kirion. Enter password length for generating a random password. ( Source )

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;


namespace SoloLearn
{
    class Program
    {
        
        private static bool checkLength = false;
        static Random rand = new Random();
        private static List<char> ascii = new List<char>();
        private static int length;
        private static int Length {
            set { if ( value >= 8 && value <= 32) {
                    length = value;
                    checkLength = true;
                    }
                    else {
                        Console.WriteLine("The Length of the password has to be between 8 and 32!");
                    }
            }
            get { return length; }
        }
        
        private static string PwGenerator(int l) {
            
            string pw = "";
            
            for ( int i = 0; i < l; i++) {
                int x = rand.Next(0, ascii.Count-1);
                pw += ascii[x];
            }
            
            return pw;
            
        }
    
        static void Main(string[] args)
        {
            
                    
            for (int i = 33; i <= 126; i++) {
                ascii.Add(Convert.ToChar(i));
            }
        
            try {
                Length = Convert.ToInt16(Console.ReadLine());
            }
            catch (Exception e) {
                Console.WriteLine("This is no valid length!");
            }
            finally {
                if (checkLength == true) {
                    Console.WriteLine("Your Password: " + PwGenerator(Length));
                }
            }
        }
    }
}

21. By Sqvlen

Made by Sqvlen. Enter password length to generate a password that contains alphabets and numbers. ( Source )

using System;
using System.Text;

namespace Sololearn
{
    class Program
    {
        static void Main(string[] args)
        {
            Password password = new Password();
        }


        class Password
        {
            public const string valid = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";

            private uint _length;

            public StringBuilder password = new StringBuilder();

            public Password()
            {
                Init();
                Generating();
            }

            private void Init()
            {
                try
                {
                    Console.Write("Enter the length of the password you want to see: ");
                    _length = Convert.ToUInt16(Console.ReadLine());
                }
                catch(Exception e)
                {
                    Console.WriteLine("Error: " + e.Message);
                }
            }

            private void Generating()
            {
                Random random = new Random();
                while (0 < _length--)
                {
                    password.Append(valid[random.Next(valid.Length)]);
                }
                Outputing();
            }

            private void Outputing()
            {
                Console.WriteLine("Generated password: " + password);
            }
        }
    }
}

22. By Piotr

C Sharp password generator by Piotr. ( Source )

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace PasswordGenerator
{
    class Program
    {
        static void Main(string[] args)
        {
            Func <int,string> passwordGenerator = (len)=>{
               Random rnd = new Random();
            string pass = "";
            int n = 0;
            while(n<(len<=8?10:(len>32?32:len)))
            {
                pass+=Convert.ToChar(rnd.Next(0,256));
                n++;
            }
            return(pass); 
            };
            int l;
            int.TryParse(Console.ReadLine(),out l);
            Console.WriteLine(passwordGenerator(l));
        }
    }
}

23. By Alex Provenzano

Made by Alex Provenzano. Enter password length to generate a random password. The passwords that you generate gets saved in a txt file and you also have the option to test password strength. ( Source )


   
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static System.Console;
using System.Diagnostics;
using System.Threading;
using System.IO;

namespace PasswordGenerator
{
    class Program
    {
        public const string Alphabet ="[email protected]#$%^&*()_+=";
        static int input;
           
        static void Main(string[] args)
        {
         
            WriteLine("Generate New Password");
            passwordGen();         
        }

        public static void passwordGen()
        {
            int length;
            string domain;
            WriteLine("Enter Desired Password Length");
            length = Convert.ToInt32(ReadLine());

            Random rand = new Random();

            char[] chars = new char[length];
            for (int i = 0; i < length; i++)
            {
                
                chars[i] = Alphabet[rand.Next(Alphabet.Length)];
            }

            WriteLine("Your password is:");
            WriteLine(chars);
            WriteLine("Enter the Domain: ");
            domain = ReadLine();

            

            StreamWriter log;

           
            Directory.CreateDirectory(@"C:\Passwords");

            if (!File.Exists(@"C:\Passwords\GeneratedPasswords.txt"))
            {
                log = new StreamWriter(@"C:\Passwords\GeneratedPasswords.txt");
                log.WriteLine("************");
                log.WriteLine("Date  {0}", DateTime.Now);
                log.WriteLine("************");
                log.WriteLine("Domain: " + domain);
                log.Write("Password: ");
                log.Write(chars);              
            }
            else
            {
                log = File.AppendText(@"C:\Passwords\GeneratedPasswords.txt");
                // Write to the file:    
                log.WriteLine("************");
                log.WriteLine("Date  {0}", DateTime.Now);
                log.WriteLine("************");
                log.WriteLine("Domain: " + domain);
                log.Write("Password: ");
                log.Write (chars);

            }

            log.Close();


            WriteLine("1. Test Strength");
            WriteLine("2. Exit ");

            input = Convert.ToInt32(ReadLine());

            if(input == 1)
            {
                passwordTest(chars, length);
            }
            else
            {
                WriteLine("Bye, Felicia.");
                Thread.Sleep(1200);
            }

            
        }

        public static void passwordTest(char[] pw, int plength)
        {
            Stopwatch timer = new Stopwatch();
            char[] pw2 = new char[plength];
            Random rand = new Random();

            timer.Start();
            while (pw2 != pw)
            {
                for (int i = 0; i < plength; i++)
                {
                    pw2[i] = Alphabet[rand.Next(maxValue: Alphabet.Length)];               
                }

                WriteLine(pw2);

                if (pw2.Take(plength).SequenceEqual(pw))
                {
                    break;
                }
                
            }
            timer.Stop();
            WriteLine("Password Took: " + timer.Elapsed + " to regenerate.");
            WriteLine("You decide the strength...");
            Read();
                                                       
        }
    }
}

24. By Sergey Steshin

Made by Sergey Steshin. Enter password length, there is no limit to the password length you want. ( Source )

using System;

namespace Password_generator
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Enter the password length...");
            int x = Convert.ToInt32(Console.ReadLine());
            string password = "";
            var rnd = new Random();
            while (password.Length < x)
            {
                Char c = (char)rnd.Next(33, 125);
                password += c;
            }
            Console.WriteLine("Your password... " + password);
            Console.Read();
        }
    }
}

25. By Constantine

Made by Constantine. The program generates a random 13 digits password with alphabets and numbers. ( Source )

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;

 namespace Dcoder
 {
     public class Program
     {
         public static void Main(string[] args)
         {
         //No comments :)
             string w = "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM";
             
             Random rnd = new Random();
             
             int z = Convert.ToInt32
             (rnd.Next(52));
             
             int x = Convert.ToInt32
             (rnd.Next(52));
             
             int c = Convert.ToInt32
             (rnd.Next(52));
             
             int v = Convert.ToInt32
             (rnd.Next(52));
             
             int b = Convert.ToInt32
             (rnd.Next(52));
             
             int n = Convert.ToInt32
             (rnd.Next(52));
             
             int m = Convert.ToInt32
             (rnd.Next(52));
             
             int a = Convert.ToInt32
             (rnd.Next(52));
             
             char Z = (w[z]);
             char X = (w[x]);
             char C = (w[c]);
             char V = (w[v]);
             char B = (w[b]);
             char N = (w[n]);
             char M = (w[m]);
             char A = (w[a]);
             string pass = Convert.ToString(Z+X+C+V+B+N+M+A);
             
             Console.WriteLine
             ("Your password:{0}{1}{2}{3}{4}{5}{6}{7}{8}{9}"
             ,pass,Z,X,C,V,B,N,M,A,z);
         }
     }
 }

26. By Spiros Baden

Made by Spiros Baden. Th program generates a random password that is 10 digits in length. ( Source )

using System;
using System.Linq;

namespace PasGen
{
    class Program
    {
        static Random rnd;
        static void Main(string[] args)
        {
            Console.WriteLine(Pass(10));
            Console.ReadLine();
        }

        static string Pass(int length)
        {
            rnd = new Random();
            string pass="";
            char[] chars = new char[93];
            for (int i = 0; i < chars.Length; i++)
            {
                chars[i] = Convert.ToChar(i + 33);
            }
            int x = 0;
            while (x < length)
            {
                char newChar = chars[rnd.Next(chars.Length)];
                if (!(pass.Contains(newChar)))
                {
                    pass += newChar.ToString();
                    x++;
                }
            }
            return pass;
        }
    }
}

27. By Cooper Allen

Made by Cooper Allen. Enter password length to generate a random password. There is no limit to the password length. ( Source )


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace SoloLearn
{
    class PasswordGenerator
    {
        static void Main()
        {
            string st1 = "abcdefghijklmnopqrstuvwxyz";
            string st2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
            string st3 = "1234567890";
            string stsym;
            int sym;
            int colsym;
            int stn;
            
            stsym = st1 + st2 + st3;
            sym = 0;
            Random rand = new Random();
            
            //Number of characters in a password
            colsym = Convert.ToInt32(Console.ReadLine());
            
            Console.WriteLine("Number of characters: " + colsym);
            Console.Write("Password: ");
            while(sym < colsym)
            {
                stn = rand.Next(0, 61);
                sym++;
                Console.Write(stsym[stn]);
            }
            if(sym == colsym)
            {
               Console.WriteLine("\n");
               Console.WriteLine("Thank's for using this program!");
            }
               
        }
    }
}

28. By Sasha_Kuprii

C Sharp password generator by Sasha_Kuprii. ( Source )

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace SoloLearn
{
	class Program
	{
		static void Main(string[] args)
		{
			int l = int.Parse(Console.ReadLine());
			Random r = new Random();
			string[] str = {"q", "w", "e" ,  "r" ,  "t" ,  "y" ,  "u" ,  "i" ,  "o" ,  "p" ,  "a" ,  "s" ,              "d" ,  "f" ,  "g" ,  "h" ,  "j" ,  "k" ,  "l" ,  "z" ,  "x" ,  "c" , 
                            "v" ,  "b" ,  "n" ,  "m" ,  "Q" ,  "W" ,  "E" ,  "R" ,  "T" ,  "Y" ,  "U" ,  "I" ,  "O" ,  "P" ,  "A" ,  "S" ,  "D" ,  "F" ,  "G" ,  "H" ,  "J" , 
                            "K" ,  "L" ,  "Z" ,  "X" ,  "C" ,  "V" ,  "B" ,  "N" ,  "M" ,  "0" ,  "1" ,  "2" ,  "3" ,  "4" ,  "5" ,  "6" ,  "7" ,  "8" ,  "9"};
            for(int i = 0; i < l; i++){
                int index = r.Next(0, 61);
                Console.Write(str[index]);
            }
                            
		}
	}
}

29. By FESDD

Made by FESDD. The program generates a 13 digits random password that contains numbers, alphabets and symbols. ( Source )

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace SoloLearn
{
	class Program
	{
		static void Main(string[] args)
		{
			Random ran = new Random();
            StringBuilder sb = new StringBuilder();
            int numbers;
            if (ran.Next(1, 3) == 1)
            {
                numbers = 5;
                for (int i = 0; i < 2; i++)
                {
                    sb.Append((char)ran.Next(33, 48));
                }
            }
            else
            {
                numbers = 6;
                sb.Append((char)ran.Next(33, 48));
            }

            for (int i = 0; i < numbers; i++)
            {
                sb.Append(ran.Next(0, 10));
            }

            for (int i = 0; i < 4; i++)
            {
                sb.Append((char)ran.Next(97, 123));
            }

            for (int i = 0; i < 2; i++)
            {
                sb.Append((char)ran.Next(65, 91));
            }


            string pwd = StringMixer(sb.ToString());
            Console.WriteLine(pwd);
		}
            
        public static string StringMixer(string s)
        {
            string output = "";
            int arraysize = s.Length;
            int[] randomArray = new int[arraysize];

            for (int i = 0; i < arraysize; i++)
            {
                randomArray[i] = i;
            }

            Fisher_Yates(randomArray);
            
            for (int i = 0; i < arraysize; i++)
            {
                output += s[randomArray[i]];
            }

            return output;
        }

        static void Fisher_Yates(int[] array)
        {
            Random rnd=new Random();
            int random;
            int temp;

            for (int i = 0; i < 12; i++)
            {
                random = i + (int)(rnd.NextDouble() * (12 - i));

                temp = array[random];
                array[random] = array[i];
                array[i] = temp;
            }
        }
	}
}

30. By Grayson Reimer

C Sharp password generator by Grayson Reimer. ( Source )

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace SoloLearn
{
    class Program
    {
        static void Main(string[] args)
        {
           int length = Convert.ToInt32(Console.ReadLine());
           Random r = new Random();
           
           char[] c = "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM,.+=%_|<>{}[][email protected]#$/^&*`~-:;,?".ToCharArray();
           
           char[] n = "1234567890".ToCharArray();
           
           for (int i = 0; i < length; i++)
           {
           if (r.Next(0, 3) == 0)
           {
               Console.Write(n[r.Next(0, 10)]);
           }
           else
           {
               Console.Write(c[r.Next(0, c.Length + 1)]);
           }
           }
            
        }
    }
}

31. By Vitaly Voytov

Made by Vitaly Voytov. Enter password length to generate a random password that contains alphabets and symbols. ( Source )

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace SoloLearn
{
    class Program
    {
        static string PasGen (int PasLength)
        {
            string CharSet = "[email protected]#$%^&*()_+";
            string Result = "";
            Random RNDDig = new Random();
            int lng = CharSet.Length;
            for (int i = 0; i < PasLength; i++) Result += CharSet[RNDDig.Next(lng)];
            return Result;
        }
        static void Main(string[] args)
        {
            int PasswordLength=1;
            string strInput = "";
            while (strInput == "") {
                Console.WriteLine("Inpun Password Length");
                strInput = Console.ReadLine();
                if (strInput != "") PasswordLength = Convert.ToInt32(strInput);
            }
            Console.WriteLine("Your Random password: {0}", PasGen(PasswordLength));
        }
    }
}

32. By Enrique DM

Made by Enrique DM. Enter password length to get a random password made using numbers and alphabets. ( Source )

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace PasswordGenerator
{
    class Program
    {
        static void Main(string[] args)
        {
            //Input lenght to password
            int len = Convert.ToInt32(Console.ReadLine());
            Random letters = new Random();
            Random lettersup = new Random();
            Random numbers = new Random();
            Random aleatory = new Random();
            string[] password = new string[len];
            for(int i = 0;i < len;i++)
            {
                int a = aleatory.Next(1,4);
                if(a == 1)
                {
                char letter = (char)letters.Next('a','z');
                 password[i] = Convert.ToString(letter);
                }
                if(a == 2)
                {
                    int num = numbers.Next(0,10);
                    password[i] = Convert.ToString(num);
                }
                if(a == 3)
                {
                    char letterup = (char)lettersup.Next('A','Z');
                    password[i] = Convert.ToString(letterup);
                }
                
            }
            Console.Write("Password:");
            foreach(string res in password)
            {
                
                Console.Write(res);
            }
            
        }
    }
}

33. By Zhenek_Penek

C Sharp Password generator by Zhenek_Penek. ( Source )

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp43
{

    class Program
    {
        static void Main(string[] args)
        {
            Password_Generator generator = new Password_Generator();                                    
              generator.generate();          
        }
    }
    class Password_Generator
    {
        public char[] numbers = new char[9] { '1', '2', '3', '4', '5', '6', '7', '8', '9' }; 
        public char[] letters = new char[26] { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' };
        public int password_length = Convert.ToInt32(Console.ReadLine());
        public string password;
        public Random rand = new Random();
        public bool password_type;
        
        public void generate()
        {
            
            for (int i = 0; i < password_length; i++)                                     /*
                                                                                                                         README
                                                                                                    Before starting the program, write the password length
                                                                                          */            
            {
                 password_type = rand.Next(10) < 5 ? true:false;
                if (password_type == false)
                {
                 password += letters[rand.Next(0, 25)];
                    continue;
                }
                else
                {
                 password += numbers[rand.Next(0, 8)];
                    continue;
                }                                      
                                                  
            }
            Console.WriteLine("Your password: {0}",password);
            Console.ReadLine(); 
        }

    }
}

34. By Heinrich Velman

Made by Heinrich Velman. Enter password length you want to generate a random password with alphabets and numbers. ( Source )

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace SoloLearn
{
	class Program
	{
		static void Main(string[] args)
        {
            Console.Write("Enter lenght of password:");
            int pl = Convert.ToInt32(Console.ReadLine());
            String password = MakePassword(pl);
            Console.Write(" \n Here's your password: " + password + "\n");
        }

        static String MakePassword(int pl) {
            String password = null;
            Random rand = new Random();
            for (int i =0; i < pl; i++) {
                String temp2 = Convert.ToString((char)rand.Next('a', 'w'));
                switch (rand.Next(0, 3)) {
                    case 0:
                        temp2 = temp2.ToUpper();
                        break;
                    case 1:
                        temp2 = temp2.ToLower();
                        break;
                    case 2:
                        temp2 = Convert.ToString(rand.Next(0, 9));
                        break;
                }
                    password += temp2;
            }
            return password;
        }
	}
}

35. By Sekiro

Made by Sekiro. Enter password length between 8 – 32 digits to generate a random password of numbers, alphabets and symbols. ( Source )

/*


*Made By Sekiro*
*/
using System;

namespace SoloLearn
{
	class Program
	{
		static class Password
		{
		    private static string letters;
		    private static string numbers;
		    private static string symbols;
		    private static int lettersLen;
		    private static int numbersLen;
		    private static int symbolsLen;
		    
		    static Password()
		    {
		        letters = "qwertyuiopasdfghjklzxcvbnm";
		        numbers = "1234567890";
		        symbols = "€&@?!#%$Β£Β₯";
		        
		        lettersLen = letters.Length - 1;
		        numbersLen = numbers.Length - 1;
		        symbolsLen = symbols.Length - 1;
		    }
		    
		    static public string Generate(int length)
		    {
		        Random rnd = new Random();
		        string pswd = "";
		        int choice;
		        int isUpper;
		        
		        do
		        {
		            choice = rnd.Next(4);
		            
		            switch (choice)
		            {
		                case 0:
		                case 1:
		                isUpper = rnd.Next(2);
		                choice = rnd.Next(lettersLen);
		                if(isUpper > 0)
		                pswd += Char.ToUpper(letters[choice]);
		                else
		                pswd += letters[choice];
		                
		                break;
		              
		                case 2:
		                choice = rnd.Next(numbersLen);
		                pswd += numbers[choice];
		                break;
		                
		                case 3:
		                choice = rnd.Next(symbolsLen);
		                pswd += symbols[choice];
		                break;
		            }
		            
		        }while((--length) > 0);
		        
		        return pswd;
		    }
		    
		}
		
		
		static void Main(string[] args)
		{
			int length = Int32.Parse(Console.ReadLine());
		    string pswd;

		    if(length >= 8 && length <= 32)
		    {
		        pswd = Password.Generate(length);
		        
		        Console.WriteLine($"The generated password is:\n{pswd}"); 
		    }
		    else
		    {
		        pswd = Password.Generate(8);
		        
		        Console.WriteLine("Invalid length! Default length set to 8.");
		        Console.WriteLine($"The generated password is:\n{pswd}");
		    }
		}
	}
}

36. By Keith Stanley πŸ‡ΏπŸ‡Ό

Made by Keith Stanley πŸ‡ΏπŸ‡Ό. It generates a random 9 digits password. ( Source )

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace SoloLearn
{
    class RandomPasswordGenerator  
    {  
    private const string CapitalLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";  
    private const string SmallLetters = "abcdefghijklmnopqrstuvwxyz";  
    private const string Digits = "0123456789";  private const string SpecialChars = "[email protected]#$%^&*()_+=`{}[]\\|':;.,/?<>";  
    private const string AllChars = CapitalLetters + SmallLetters + Digits + SpecialChars;  
    private static Random rnd = new Random();  
    
    static void Main()  {  
    StringBuilder password = new StringBuilder(); 
     
    // Generate two random capital letters  
    for (int i = 1; i <= 2; i++)  {  
    char capitalLetter = GenerateChar(CapitalLetters);  InsertAtRandomPosition(password, capitalLetter);  
    }  
    
    // Generate two random small letters  
    for (int i = 1; i <= 2; i++)  {  
    char smallLetter = GenerateChar(SmallLetters);  InsertAtRandomPosition(password, smallLetter); 
     }  
     
     // Generate one random digit  
     char digit = GenerateChar(Digits);  InsertAtRandomPosition(password, digit);  
     
     // Generate 3 special characters  
     for (int i = 1; i <= 3; i++)  {  
     char specialChar = GenerateChar(SpecialChars);  InsertAtRandomPosition(password, specialChar);  }  
     
     // Generate few random characters (between 0 and 7)  
     int count = rnd.Next(8);  
     for (int i = 1; i <= count; i++)  {   
     char specialChar = GenerateChar(AllChars);  InsertAtRandomPosition(password, specialChar);  
     }  
     Console.WriteLine(password);  
     }  
     
     private static void InsertAtRandomPosition(  StringBuilder password, char character)  {  
     int randomPosition = rnd.Next(password.Length + 1);  password.Insert(randomPosition, character);
}
private static char GenerateChar(string availableChars) { 
int randomIndex = rnd.Next(availableChars.Length); char randomChar = availableChars[randomIndex]; 
return randomChar;
}
}
}

37. By Dominik ChmelΓ­k

Made by Dominik ChmelΓ­k. The program generates a password with numbers and alphabets. ( Source )

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SoloLearn
{
	class Program
	{
		static void Main(string[] args)
		{
			int length = int.Parse(Console.ReadLine()); // to input: type password length
			Console.WriteLine("Your password is: " 
					+ Password.Generate(length));
		}
	}

	class Password
	{
		static Random rnd;
		static string newPassword;
		static string chars = "abcdefghijklmnopqrstuvwxyz";
		static string bigChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
		static string nums = "0123456789";
		static string allChars = chars + bigChars + nums;
		
		public static string Generate(int length)
		{
			newPassword = "";
			rnd = new Random();
			for(int i = 0; i < length; i++)
			{
				newPassword += allChars[rnd.Next(0,allChars.Length)];
			}
			return newPassword;
		}
	}
}

38. By Mahir

Made by Mahir. ( Source )

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

//Put an integer input <---

namespace SoloLearn
{
    class Program
    {
        static Random r= new Random();

        static char[] keys = {
        'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z',
        
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
            '1','2','3','4','5','6','7','8','9','0'
      
,'@',';',':','/','?','!','#','Β£','[',']','(',')','{','}','~','Β¦','Β¬','_','-','=','+','*'

 };

static void Main()
{
   Console.WriteLine("¦¦MADE BY @TWEETMCPE¦¦");
   Start();
}

        static void Start() {
            
            int length = Convert.ToInt32(Console.ReadLine());
            Gen(length);
        }

        static void Gen(int x) {
            string pass = "";
            for (int i = 0; i < x; i++) {
                pass += keys[r.Next(0,keys.Length)];
            }
            Console.WriteLine("> Here is your password:\n"+pass+"\n");
            
            if (x >= 100 && x < 100000) { Console.WriteLine("> That's a really long password you're using. You can never be too safe.\n"); }
            if (x >= 100000) { Console.WriteLine("> This software is written in C# which is fairly efficient. But placing very large numbers may be taxing on your device.\n"); }
            Console.WriteLine("----------------SHUTTING DOWN------------------\n");
        }

    }
}

39. By Ivan Ponomarev

Basic C Sharp password generator by Ivan Ponomarev. It generates a random 16 digits password by Ivan Ponomarev. ( Source )

using System;
using static System.Console;

namespace random {
    public class Password {
        static void Main() {
            string charsCaps = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
            string chars = "abcdefghijklmnopqrstuvwxyz";
            string nums = "0123456789";
            string symbols = "[email protected]#$%^&*_=+-/€.?<>)";
            string allSymbols = charsCaps + chars + nums + symbols;
            string pass = "";
            
            int len = 16; // Password Length
            Random rand = new Random();
            
            for(int i = 0; i < len; i++) {
                pass += allSymbols[rand.Next(allSymbols.Length)];
            }
            WriteLine(pass);
        }
    }
}

40. By Akash Pal

Made by Akash Pal. Enter password length to get a random password. ( Source )

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace SoloLearn
{
    class Program
    {
        
        static void  PGenerator(int lengthpass) {
            string Chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
            Random randomate = new Random();
            string passwordGen = Chars;
            Console.WriteLine("This is Oronn's code. I have just upgraded it.");
            Console.WriteLine("Your New Password is : ");
            for (int i =0; i < lengthpass; i++)
            {
               Console.Write ( passwordGen[randomate.Next(passwordGen.Length)]); 
            }
           
        }
        static void Main(string[] args)
        {
            int lengthpass = 0;
            lengthpass = Convert.ToInt32(Console.ReadLine());
            PGenerator(lengthpass);
        }
    }
}

41. By Gabriel Popa

Made by Gabriel Popa. Enter password length between 8 – 255 to get a random password. ( Source )

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

/*
Input the length of the password (<= to 8 and >= 255)

Note: strong passwords are at least 16 characters long and usually you won't need one that's greater than 32.
*/

namespace SoloLearn
{
    class Program
    {
        static char[] chars = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z','1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '/', '.', ',', '!', '@', '#', '$', '%', '&', '*', '(', ')', '-', '_', '+', '[', ']'};
        static void Main(string[] args)
        {
            Console.WriteLine("Password Generator v1.0\r\n");
            try
            {
                int input = Int32.Parse(Console.ReadLine());
                if(input <= 255 && input >= 8)
                {
                    Console.WriteLine("Generated password: " + Generate(input));
                }
                else
                {
                    Console.WriteLine("ERROR: The input must be between 8 and 255.");
                }
            }
            catch(Exception)
            {
                Console.WriteLine("ERROR: You need to input a number!");
            }
        }
        
        static string Generate(int count)
        {
            Random rand = new Random();
            string pass = string.Empty;
            
            for(int i = 0; i < count; i++)
            {
                pass += chars[rand.Next(0, chars.Length - 1)].ToString();
            }
            
            return pass;
        }
    }
}

42. By Florian

Made by Florian. Enter password length in first line and the password seed in the second line, the seed can be any text you want ( The output of the seed will be the same if the password length is also entered same again and again ). ( Source )

using System;
using System.Collections.Generic;

namespace Seed_Pass{
	class MainClass
	{
		public static void Main(string[] args)
		{
		    //In the first line write how many letters the Password should have
		    //In hte second line write the seed for the Password
		    //Example:  8
		    //          Sololearn
		    
			Dictionary<char, int> encode = new Dictionary<char, int>{
				{'A', 1}, {'B', 2}, {'C', 3}, {'D', 4}, {'E', 5},
				{'F', 6}, {'G', 7}, {'H', 8}, {'I', 9}, {'J', 10},
				{'K', 11}, {'L', 12}, {'M', 13}, {'N', 14}, {'O', 15},
				{'P', 16}, {'Q', 17}, {'R', 18}, {'S', 19}, {'T', 20},
				{'U', 21}, {'V', 22}, {'W', 23}, {'X', 24}, {'Y', 25}, {'Z', 26}
			};
			Dictionary<int, string> decode = new Dictionary<int, string>{
				{1, "A"}, {2, "B"}, {3, "C"}, {4, "D"}, {5, "E"},
				{6, "F"}, {7, "G"}, {8, "H"}, {9, "I"}, {10, "J"},
				{11, "K"}, {12, "L"}, {13, "M"}, {14, "N"}, {15, "O"},
				{16, "P"}, {17, "Q"}, {18, "R"}, {19, "S"}, {20, "T"},
				{21, "U"}, {22, "V"}, {23, "W"}, {24, "X"}, {25, "Y"}, {26, "Z"},

				{27, "a"}, {28, "b"}, {29, "c"}, {30, "d"}, {31, "e"},
				{32, "f"}, {33, "g"}, {34, "h"}, {35, "i"}, {36, "j"},
				{37, "k"}, {38, "l"}, {39, "m"}, {40, "n"}, {41, "o"}, 
				{42, "p"}, {43, "q"}, {44, "r"}, {45, "s"}, {46, "t"},
				{47, "u"}, {48, "v"}, {49, "w"}, {50, "x"}, {51, "y"}, {52, "z"}, 

				{53, "0"}, {54, "1"}, {55, "2"}, {56, "3"}, {57, "4"},
				{58, "5"}, {59, "6"}, {60, "7"}, {61, "8"}, {62, "9"},
			};
			int Digits = int.Parse(Console.ReadLine());
			string input = Console.ReadLine();
			int seed = 0;
			for (int i = 0; i < input.Length; i++)
			{
				seed += encode[input.ToUpper()[i]];
			}
			Random r = new Random(seed);
			string Pass = "";
			for (int i = 0; i < Digits; i++)
			{
				Pass += decode[r.Next(1, decode.Count)];
			}
			Console.Write(Pass);
			//Console.Read();
		}
	}
}
//Copyright Florian Gagel 2017

43. By Andron

Made by Andron. The program generates a random 10 digits password. ( Source )

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace SoloLearn
{
    class Program
    {
        static void Main(string[] args)
        {
            Random rnd = new Random();///
    int a = rnd.Next(62); ///
    int b = rnd.Next(62);
    int c = rnd.Next(62);
    int d = rnd.Next(62);
    int e = rnd.Next(62);
    int g = rnd.Next(62);
    int f = rnd.Next(62);
    int ch1 = rnd.Next(51,62);///
    int ch2 = rnd.Next(51,62);
    int ch3 = rnd.Next(51,62);
    
    
    
    
    string[] kek = new string[62]{"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","1","2","3","4","5","6","7","8","9","0"};///
    string a1 = kek[a];
    string a2 = kek[b];/// 
    string a3 = kek[c];
    string a4 = kek[d];///
    string a5 = kek[e];
    string a6 = kek[f];
    string a7 = kek[g];
    string a10 = kek[ch1];
    string a8 = kek[ch2];
    string a9 = kek[ch3];
     string password = a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8 + a9 + a10 ;
     
     Console.WriteLine("your password is:");
    Console.WriteLine(password);///
    ///
    
    
        }
    }
}

44. By Shiro

Made by Shiro. Enter password length to generate a random password. The program also shows whether the password generated is strong or not. ( Source )

using System;
using System.Text;
using System.Text.RegularExpressions;

class Program {
    static void Main(string[] args) {
        string chars = "[email protected]#€%&<>+()*'\":;!?$_-";
        PwGenUI.Minimalistic(chars);
    }
}

class PwGenUI {
    public static void Minimalistic(string chars) {
        int length = Int32.Parse(Console.ReadLine());
        string password = Gen.randomString(chars, length);
        string securityLevel = Gen.pwSecurityLevel(password);
        Console.WriteLine("Your random password is: {0}", password);
        Console.WriteLine("[BETA] Security Level (1-4): {0}", securityLevel);
    }
}

class Gen {
    
    public static string randomString(string chars, int length) {
        Random rnd = new Random();
        StringBuilder sb = new StringBuilder(length);
        for (int i = 0; i < length; i++) {
            sb.Append(chars[rnd.Next(chars.Length)]);
        }
        return sb.ToString();
    }
    public static string pwSecurityLevel(string password) {
        int securityLevel = 0;
        Regex hasLowCase = new Regex("[a-z]");
        Regex hasUpCase = new Regex("[A-Z]");
        Regex hasNum = new Regex("[0-9]");
        Regex hasSpecialChar = new Regex("[@#€%&<>+()*'\":;!?$_-]");
        if (hasLowCase.IsMatch(password)) {
            securityLevel += 1;
        }
        if (hasUpCase.IsMatch(password)) {
            securityLevel += 1;
        }
        if (hasNum.IsMatch(password)) {
            securityLevel += 1;
        }
        if (hasSpecialChar.IsMatch(password)) {
            securityLevel += 1;
        }
        switch(securityLevel) {
            case 0:
            return "0 (Invalid)";
            case 1:
            return "1 (Very weak)";
            case 2:
            return "2 (Weak)";
            case 3:
            return "3 (Strong)";
            case 4:
            return "4 (Very Strong)";
            default:
            return "Error getting securityLevel";
        }
    }
}

45. By Dennis Walkewitz

Made by Dennis Walkewitz. An advanced password generator with some options. You can mix options with the pipe | operator. Its also possible to prevent repetitions of chars. ( Source )

Symbols and Uppercase: LAH#$%
Numbers and Lowercase: zf0sqt
All options: btKYHq
All options and possible repetitions: tGd1&I
using System;
using System.Collections.Generic;

namespace SoloLearn
{

    class Program
    {
        static string symbols = "[email protected]#$%^&*()-_?";
        static string numbers = "01234567890";
        static string uppercase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
        static string lowercase = "abcdefghijklmnopqrstuvwxyz";
        
        
        static Random random = new Random();
       
        enum PasswordGenerationOptions
        {
            Symbols   = 1,
            Numbers   = 2,
            Uppercase = 4,
            Lowercase = 8
        }
        
        static void Main(string[] args)
        {
            const int MaxLength = 16;
            const int MinLength = 5;
            int length = random.Next(MinLength, MaxLength);
            
            string symbolsAndUppercase = GeneratePassword(length, PasswordGenerationOptions.Symbols| PasswordGenerationOptions.Uppercase);
            string numbersAndLowercase = GeneratePassword(length, PasswordGenerationOptions.Numbers| PasswordGenerationOptions.Lowercase);
            string all = GeneratePassword(length);
            string allWithRepetitions = GeneratePassword(length, true);
            
            Console.WriteLine("Symbols and Uppercase: " + symbolsAndUppercase);
            Console.WriteLine("Numbers and Lowercase: " + numbersAndLowercase);
            Console.WriteLine("All options: " + all);
            Console.WriteLine("All options and possible repetitions: " + allWithRepetitions);
        }
        
        static string GeneratePassword(int length,  PasswordGenerationOptions options, bool allowRepetition = false)
        {
            if(length < 1)
              return string.Empty;
   
            char[] password = new char[length];
            string passwordChars = string.Empty;
            
            
            if((options & PasswordGenerationOptions.Symbols) == PasswordGenerationOptions.Symbols)
            {
                passwordChars += symbols;
            }
            if((options & PasswordGenerationOptions.Numbers) == PasswordGenerationOptions.Numbers)
            {
                passwordChars += numbers;
            }
            if((options & PasswordGenerationOptions.Uppercase) == PasswordGenerationOptions.Uppercase)
            {
                passwordChars += uppercase;
            }
            if((options & PasswordGenerationOptions.Lowercase) == PasswordGenerationOptions.Lowercase)
            {
               passwordChars += lowercase;
            }
            
            
            for(int i = 0; i < length;i++)
            {
                int charIndex= random.Next(passwordChars.Length);
                char toAdd = passwordChars[charIndex];
                
                if(!allowRepetition && i > 0 && password[i-1] == toAdd)
                {
                    //substract one from index to have the loop start over with the current index
                    i--;
                }
                else
                {
                    password[i] = toAdd;
                }
            }
            return new string(password);
        }
        
        //Helper method to use all options at once
      static string GeneratePassword(int length, bool allowRepetition = false)
        {
            return GeneratePassword(length, PasswordGenerationOptions.Symbols | PasswordGenerationOptions.Numbers | PasswordGenerationOptions.Uppercase | PasswordGenerationOptions.Lowercase, allowRepetition);
        }
    }
}

46. By PedroJulian Moreno Beltran

Made by PedroJulian Moreno Beltran. ( Source )

Type a password, only four characters
Q for exit

1234
Your password is 1234
Generated Password is aaoe
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;


namespace SoloLearn
{
    class Program
    {   
        static string generatePswd(int length)
        {
            const string validChars = "aaaaaaaaaabcdeeeeefghiiiiiiijklmnooooooopqrstuuuuvwxyz";
            StringBuilder res = new StringBuilder();
            Random rnd = new Random();
            while (0 < length--)
            {
                res.Append(validChars[rnd.Next(validChars.Length)]);
            }
            return res.ToString();
        }

        static void Main(string[] args)
        {
           
            int times = 1;//times to build solution
            int attemps = 1; //Attemps to generate passwords
            const int Maxattemps = 100; 
            const int length = 4; //password lengths
            string sol = "****";
            string passw = " ";// your password
            string pass = " "; //generated password
            Console.WriteLine("Type a password, only four characters");
            Console.WriteLine("Q for exit");
            passw = Console.ReadLine();
            Console.WriteLine("Your password is " + passw);
         
           do {
               
                pass = generatePswd(length);
                Thread.Sleep(1);
                Console.WriteLine("Generated Password is " + pass);
                Console.WriteLine("Resting " + (Maxattemps - attemps) + " attemps");
                attemps++;
                for (int i = 0; i < pass.Length; i++) {
                    if (pass[i] == passw[i])
                    {

                        Console.WriteLine("A CHAR IS FOUND " + pass[i]);
                        if (!sol.Contains(pass[i].ToString()))
                        {
                           
                            times++;
                        }
                  
                    }
                }
            }
                while ((pass != passw) && (attemps <= Maxattemps) && (passw != "Q")&&(times<5));
               
                Console.WriteLine("Congratulations you can bless all the chars of password in " + attemps+ " attemps");
            Console.Read();
            
            
        }


    }
}

47. By Asterisk

Made by Asterisk. Password generator by character type. ( Source )

Password: '669FL]l|@=|Ozu
using System; 
using System.Linq;
using System.Text;
using static System.Console;

namespace SoloLearn
{
    [Flags]
    enum CharTypes
    {
        None = 0,
        Digit = 1,
        Upper = 2,
        Lower = 4,
        Punctuation = 8,
        Symbol = 16
    }
    
    static class Password
    {
        static readonly char[] digit = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' };
        static readonly char[] upper = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' };
        static readonly char[] lower = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' };
        static readonly char[] punctuation = { '!', '\"', '#', '%', '&', '\'', '(', ')', '*', ',', '-', '.', '/', ':', ';', '?', '@', '[', '\\', ']', '_', '{', '}' }; 
        static readonly char[] symbol = { '$', '+', '<', '=', '>', '^', '|', '~' }; 
        static Random rnd = new Random();
        
        public static string Generate(int length, CharTypes types)
        {
            if (length < 5)
            {
                WriteLine("Invalid password length value.\nThe length of the password must be not less than 5");
                return null;
            }
            
            string[] typeValues = GetSetValues(types);
            StringBuilder password = new StringBuilder();
            int count = length / typeValues.Length;
            
            foreach (string type in typeValues)
                Switcher(password, type, count);
                
            if (length != count * typeValues.Length)
                Switcher(password, typeValues[0], length - (count * typeValues.Length));
            
            return new String(password.ToString().OrderBy(c => rnd.Next()).ToArray());
        }
        
        static string[] GetSetValues(CharTypes types)
        {
            return types.ToString()
                .Split(new char[] { ',', ' ' }, StringSplitOptions.RemoveEmptyEntries);
        }
        
        static string GeneratePart(char[] chars, int count)
        {
            StringBuilder tmp = new StringBuilder();
            for (int j = 0; j < count; j++)
                tmp.Append(chars[rnd.Next(chars.Length)]);
            return tmp.ToString(); 
        }
        
        static void Switcher(StringBuilder password, string type, int count)
        {
            switch (type)
            {
                case "Digit":
                    password.Append(GeneratePart(digit, count));
                    break;
                case "Upper":
                    password.Append(GeneratePart(upper, count));
                    break;
                case "Lower":
                    password.Append(GeneratePart(lower, count));
                    break;
                case "Punctuation":
                    password.Append(GeneratePart(punctuation, count));
                    break;
                case "Symbol":
                    password.Append(GeneratePart(symbol, count));
                    break;
            }
        }
    }
    
    //Testing
    class Program
    {
        static void Main(string[] args)
        {
            CharTypes types = CharTypes.Digit | CharTypes.Lower | CharTypes.Symbol | CharTypes.Upper | CharTypes.Punctuation;
            int length = 15;
            
            string password = Password.Generate(length, types);
            
            WriteLine($"Password: {password}");
        }
    }
}