Example #1
0
        private void Generate_Click_1(object sender, EventArgs e)
        {
            textBox2.Text = GenerateStuff.FinalOutput;
            GS.GeneratePassword();
            textBox1.Text = GenerateStuff.FinalOutput;
            Phonetics pho = new Phonetics();

            PhoOutput.Text = pho.PhoneticEnator();
        }
 private void Button2_Click(object sender, EventArgs e)
 {
     if (textBox1.Text == null)
     {
     }
     else
     {
         Phonetics.PhoneticEnatorPos--;
         PhoOutput.Text = Phonetics.PhoneticEnator();
     }
 }
        public int insts;                                              //secret Var

        public void GeneratePassword()                                 //first func to be run in this class
        {
            //Thread.Sleep(insts * 2000);
            insts++;
            generateRandomWords(); //assigns random numbers and ensures they are legal
            switch (RNG)           // checks how the word should end up look
            {
            case int n when(RNG <= 33):
                FinalOutput = genAdjectiveList() + genNounList() + GenNumber();

                break;

            case int n when(RNG <= 66 && RNG >= 34):
                FinalOutput = genColorList() + genNounList() + GenNumber();

                break;

            case int n when(RNG <= 99 && RNG >= 67):
                FinalOutput = genNounList() + GenNumber();

                break;
            }
            if (wordsAmount == 3) //checks if system wants three words or two
            {
                switch (RNG)
                {
                case int n when(RNG <= 33):
                    FinalOutput = genAdjectiveList() + genNounList() + GenNumber();

                    break;

                case int n when(RNG <= 66 && RNG >= 34):
                    FinalOutput = genColorList() + genNounList() + GenNumber();

                    break;

                case int n when(RNG <= 99 && RNG >= 67):
                    FinalOutput = genAdjectiveList() + FinalOutput;

                    break;
                }
            }

            if (FinalOutput.Length <= charmin || FinalOutput.Length >= charmax)
            {
                GeneratePassword(); //rerun code until we create a password that is viable (between min and max chars)
            }


            //Phonetics alph = new Phonetics(); //creates an instance of the dictionary
            Phonetics.PhoneticEnatorPos = 0; //resets the current position of the phonetic reader (second text box)
            Phonetics.PhoneticEnator();      //runs function to convert the password into phonetic alphabet
        }
Example #4
0
 private void Button1_Click(object sender, EventArgs e)
 {
     if (textBox1.Text == null)
     {
     }
     else
     {
         Phonetics pho = new Phonetics();
         Phonetics.PhoneticEnatorPos++;
         PhoOutput.Text = pho.PhoneticEnator();
     }
 }
        private void Button3_Click(object sender, EventArgs e)
        {
            GenerateStuff GS = new GenerateStuff();

            for (int i = 0; i <= 1000000; i++)
            {
                Console.WriteLine("----------------");

                GS.GeneratePassword();
                textBox1.Text  = GenerateStuff.FinalOutput;
                PhoOutput.Text = Phonetics.PhoneticEnator();
                Console.WriteLine(GenerateStuff.FinalOutput);
            }
        }
        private void Generate_Click_1(object sender, EventArgs e)
        {
            GenerateStuff GS = new GenerateStuff();

            if (checkBox1.Checked) //do you want to use special characters
            {
                GS.GeneratePassword();
                GenerateStuff.FinalOutput = Phonetics.generateSpecialChar(GenerateStuff.FinalOutput);
                textBox1.Text             = GenerateStuff.FinalOutput;

                PhoOutput.Text = Phonetics.PhoneticEnator();
            }
            else
            {
                GS.GeneratePassword();
                textBox1.Text  = GenerateStuff.FinalOutput;
                PhoOutput.Text = Phonetics.PhoneticEnator();
            }
        }
        public string[] linesAD, linesNoun, linesColor;      //creates arrays for the password generator to use for storing words
        public void GeneratePassword()                       //first func to be run in this class
        {
            checkRandomShit();                               //assigns random numbers and ensures they are legal

            if (RNG <= rngRange)                             //creates the password with adjective (if the random number generator is within the field)
            {
                FinalOutput = genAdjectiveList() + genNounList() + GenNumber();
            }
            else if (RNG >= rngRange)//creates the password with color (if the random number generator is within the field)
            {
                FinalOutput = genColorList() + genNounList() + GenNumber();
            }


            Phonetics alph = new Phonetics(); //creates an instance of the dictionary

            Phonetics.PhoneticEnatorPos = 0;  //resets the current position of the phonetic reader (second text box)
            alph.PhoneticEnator();            //runs function to convert the password into phonetic alphabet
        }