using System.Collections.Generic;
Dictionary<string, string> ID;
Dictionary<string, string> Username;
Dictionary<string, string> Password ;
this.ID = new Dictionary<string, string> ();
this.Username = new Dictionary<string, string> ();
this.Password = new Dictionary<string, string> ();
this.random = new Random() ;
public int GenerateRecord ()
public int GeneratePassword ()
public void AddID (string description, string ID)
this.ID.Add(description, ID);
public void AddUsername (String description, String Username)
this.Username.Add(description, Username);
public void AddPassword (String description, String Password)
this.Password.Add(description,Password);
public void PrintAllUsername()
foreach(KeyValuePair<string, string> entry in this.Username)
Console.WriteLine(entry.Key + ": " + entry.Value);
public void PrintAllPassword()
foreach(KeyValuePair<string, string> entry in this.Password)
Console.WriteLine(entry.Key + ": " + entry.Value);
public static void Main()
Console.WriteLine(" Preparing new record to be stored in our Dictionary ! " );
int record1 = file1.GenerateRecord() ;
Console.WriteLine("The randomly generated number for that record is " + record1 );
file1.AddUsername("Username" + record1.ToString() + " : " , "Michel");
file1.AddPassword("Passwoed : " ,file1.GeneratePassword().ToString());
file1.PrintAllUsername();
Console.WriteLine( " Catogry " + record1 + " : even " );
Console.WriteLine("Catogry" + record1+ " : odd ") ;
file1.PrintAllPassword();
int record2 = file2.GenerateRecord ();
file2.AddUsername("Username" + record2 + " : " , "Michel");
file2.AddPassword("Passwoed : " , file2.GeneratePassword().ToString());
file2.PrintAllUsername();
Console.WriteLine( " Catogry " + record2 + " : even " );
Console.WriteLine("Catogry" + record2+ " : odd ") ;
file2.PrintAllPassword();
Dictionary <string, File> Elements = new Dictionary <string,File> ();
Elements.Add("element 1 " , file1);
Elements.Add("element 2 " , file2);