mercredi 28 mars 2018

C++ | Change value of string based on checkbox that is checked

I am trying to make a simple password generator and have a selection of checkboxes that change the type of items that can be generated into the password. How can I put the right value when a certain check box is checked. Below is my attempt at doing this. Thanks!

if(CheckBox1->Checked == true){
    letters = "abcdefghijklmnopqrstuvwxyz";
    amount = 26;
    if(CheckBox2->Checked == true){
        letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
        amount = 52;
        if(CheckBox4->Checked == true){
            letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
            amount = 62;
            if(CheckBox3->Checked == true){
                letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@#$%^&*()";
                amount = 72;
            }
        }
    }
}




Aucun commentaire:

Enregistrer un commentaire