Exemple #1
0
        private void btnExit_Click(object sender, EventArgs e)
        {
            CryptageEtHachage.HashXmlUsers(Variables.UserNom, Variables.UserPass, Application.StartupPath + "\\users.xml");


            Application.Exit();
        }
Exemple #2
0
 private void button3_Click(object sender, EventArgs e)//ex
 {
     sonssex = new string[26];
     sonsEx.Load(Application.StartupPath + @"\francais.xml"); CryptageEtHachage.DeCrypNode(sonsEx.DocumentElement); sonssex = sonsEx.GetElementsByTagName("choicesSons")[0].InnerText.Split(','); timer1.Start();
     x    = new Bitmap(Application.StartupPath + @"\Pics\Lettres\cochericon.png"); panel2.Visible = false;
     theo = new Bitmap(Application.StartupPath + @"\Pics\Lettres\th.png"); pictureBox7.Image = theo;
 }
        private void encadrerEntourer_Load(object sender, EventArgs e)
        {
            gram = new XmlDocument();
            gram.Load(Application.StartupPath + @"\francais.xml"); CryptageEtHachage.DeCrypNode(gram.DocumentElement);
            suivant();
            //for (int j = 0; j < 5; j++)
            //{
            //    s = gram.GetElementsByTagName("VerbesEtSujets")[0].InnerText.Split('=')[(int)ar[j]].Trim(' ');
            //mots.AddRange(s.Split('8'));
            //motsLabels = new Label[mots.Count];

            //    //pp[j] = new Panel(); pp[j].Size = new Size(750, 50); pp[j].BackColor = Color.Transparent; pp[j].Location = new Point(20, j * 50 + j * 5);// pp[j].MouseDown += pp_mousedwn; pp[j].MouseMove += pp_mousemove; pp[j].MouseUp += pp_mouseUp;
            //    //this.Controls.Add(pp[j]);
            //    for (int i = 0; i < mots.Count; i++)
            //    {
            //        Label l = new Label(); l.BackColor =; l.ForeColor = Color.Black; l.TextAlign = ContentAlignment.MiddleCenter; l.Font = new Font("Comic SAns MS", 8f);
            //        l.Location = new Point(100 + i * 100, 50*j+10);

            //        motsLabels[i] = l;
            //        if (mots[i][mots[i].Length - 1] == '1') { mots[i] = mots[i].Remove(mots[i].Length - 1); answr1.Add(motsLabels[i]); }
            //        else if (mots[i][mots[i].Length - 1] == '2') { mots[i] = mots[i].Remove(mots[i].Length - 1);  answr2.Add(motsLabels[i]); }
            //        motsLabels[i].Text = mots[i];motsLabels[i].MouseDown += lbl_mousemouve;motsLabels[i].MouseMove += lbl_mousedwn;panel1 .Controls.Add(motsLabels[i]); motsLabels[i].BringToFront();


            //    }
            //    motsLabels = null; mots = new List<string>();
            //}
        }
 public Dictée()
 {
     InitializeComponent();
     conjugaison = new XmlDocument();
     conjugaison.Load(Application.StartupPath + @"\francais.xml");
     CryptageEtHachage.DeCrypNode(conjugaison.DocumentElement);
 }
        private void Form1_Load(object sender, EventArgs e)
        {
            CryptageEtHachage.CombineUsersElements(CryptageEtHachage.HashPasswordsAndScores(Variables.UserNom), CryptageEtHachage.HashPasswordsAndScores(Variables.UserPass), Application.StartupPath + "\\users.xml");
            // Audio manzu3 hek wahdu
            prof.Load(Application.StartupPath + "\\Prof.xml");
            if (Variables.ExisteMessage(Variables.UserNom))
            {
                pictureBox2.Image = Properties.Resources.newMsg;
            }
            for (lecons lcs = lecons.Conjugaison1; lcs < lecons.Clock; lcs++)
            {
                prof.Load(Application.StartupPath + "\\Prof.xml");

                if ((int)lcs < 5)
                {
                    if (Variables.exSup[i] != prof.SelectSingleNode("Prof/Francais/" + lcs + " / Questions").InnerText.Split(',').Length.ToString())
                    {
                        Suppex.Image = Properties.Resources.newASsignment; break;
                    }
                    ; i++;
                }
                else if ((int)lcs < 16)
                {
                    if (Variables.exSup[i] != prof.SelectSingleNode("Prof/Maths/" + lcs + "/Questions").InnerText.Split(',').Length.ToString())
                    {
                        Suppex.Image = Properties.Resources.newASsignment; break;
                    }
                    ; i++;
                }
                else
                {
                    if (Variables.exSup[i] != prof.SelectSingleNode("Prof/Sciences/" + lcs + "/Questions").InnerText.Split(',').Length.ToString())
                    {
                        Suppex.Image = Properties.Resources.newASsignment; break;
                    }
                    ; i++;
                }
            }
            dr = Variables.XmlReader(Application.StartupPath + "\\users.xml");
            Variables.exSup = dr[0]["exSupp"].ToString().Split(',');

            if ((string)dr[0]["Type"] == "Prof")

            {
                Suppex.Visible  = false;
                addFile.Visible = true;
            }
            else
            {
                addFile.Visible = false;
                Suppex.Visible  = true;
            }

            mediaplayer.CreateControl();
            mediaplayer.URL = Application.StartupPath + "\\Sounds\\Intro0.m4a";
            mediaplayer.Ctlcontrols.play();
        }
        private void pictureBox1_Click(object sender, EventArgs e)
        {
            CryptageEtHachage.HashXmlUsers(Variables.UserNom, Variables.UserPass, Application.StartupPath + "\\users.xml");
            Variables.formLogin = new Page_entrée();
            Variables.formLogin.Show();

            this.Close();
            Variables.formLogin.ShowInTaskbar = true;
        }
        public jeux_verbes()
        {
            InitializeComponent();
            dr = Variables.XmlReader(Application.StartupPath + "\\users.xml");
            XmlDocument conjugaison = new XmlDocument();

            conjugaison.Load(Application.StartupPath + @"\francais.xml"); CryptageEtHachage.DeCrypNode(conjugaison.DocumentElement);
            presentt    = conjugaison.GetElementsByTagName("present"); passeCompose = conjugaison.GetElementsByTagName("passeCompose");
            passesimple = conjugaison.GetElementsByTagName("passeSimple"); futursimple = conjugaison.GetElementsByTagName("futureSimple"); imparfait = conjugaison.GetElementsByTagName("imparfait");
        }
Exemple #8
0
        public cours_Orthographe()
        {
            InitializeComponent();

            XmlDocument conjugaison = new XmlDocument();

            conjugaison.Load(Application.StartupPath + @"\francais.xml"); CryptageEtHachage.DeCrypNode(conjugaison.DocumentElement);
            TrueAnswers  = conjugaison.GetElementsByTagName("TrueHom")[0].InnerText.Split(',');
            FalseAnswers = conjugaison.GetElementsByTagName("FalseHom")[0].InnerText.Split(',');
        }
Exemple #9
0
        private void btnExit_Click(object sender, EventArgs e)
        {
            if (int.Parse(dr[0]["Perim"].ToString()) < score)
            {
                dr[0]["Perim"] = score; Variables.XmlWriter(Application.StartupPath + "\\users.xml");
            }
            CryptageEtHachage.HashXmlUsers(Variables.UserNom, Variables.UserPass, Application.StartupPath + "\\users.xml");

            Application.Exit();
        }
Exemple #10
0
        private void pictureBox3_Click(object sender, EventArgs e)
        {
            if ((int.Parse(dr[0]["Suitenb"].ToString()) > t) && (BeePic.Bounds.IntersectsWith(PicBeehive.Bounds)))
            {
                dr[0]["Suitenb"] = t;
                Variables.XmlWriter(Application.StartupPath + "\\users.xml");
            }
            Application.Exit();

            CryptageEtHachage.HashXmlUsers(Variables.UserNom, Variables.UserPass, Application.StartupPath + "\\users.xml");
        }
        public static bool RechercheDeUserName(string s)
        {
            DataSet ds = new DataSet();

            ds.ReadXml(Application.StartupPath + "\\users.xml");
            DataTable dt = ds.Tables[0];

            DataRow[] d = dt.Select("[user]='" + CryptageEtHachage.HashPasswordsAndScores(s) + "'");//cryptage de s//ok
            if (d.Length == 0)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }
Exemple #12
0
 private void Form1_Load(object sender, EventArgs e)
 {
     gram = new XmlDocument();
     dr   = Variables.XmlReader(Application.StartupPath + "\\users.xml");
     gram.Load(Application.StartupPath + @"\Gramm.xml");
     if (gram2)
     {
         panel2.Visible = true;
     }
     if (!cours)
     {
         button11.Click  += lvl1_grams
         ; button3.Click += lvl1_grams;
         button4.Click   += lvl1_grams;
         button7.Click   += lvl1_grams;
         button6.Click   += lvl1_grams;
         button9.Click   += lvl1_grams;
     }
     CryptageEtHachage.DeCrypNode(gram.DocumentElement);
 }
Exemple #13
0
        public static void ShowTotaleMessage(string s, out Queue q1, out Queue q2, out Queue a1, out Queue a2)//message
        {
            q1 = new Queue(); q2 = new Queue(); a1 = new Queue(); a2 = new Queue(); string z;
            DataSet   ds = new DataSet(), ds2 = new DataSet(); int i = 0; ds.ReadXml("message.xml"); ds2.ReadXml("users.xml");
            DataTable dt = ds.Tables[0], dt2 = ds2.Tables[0];

            while (i < dt.Rows.Count)
            {
                if (s == dt.Rows[i][0].ToString())
                {
                    DataRow[] dr = dt2.Select("(([user] = '" + dt.Rows[i][0].ToString() + "'))");
                    z = dr[0]["Type"].ToString();

                    q1.Enqueue(dt.Rows[i][2].ToString());  a1.Enqueue(z + " " + dt.Rows[i][1].ToString());
                }                                                                                           //dt.Rows[i][1].ToString() bdna naarf l type l hal esm so mnbrm aale avec cryptage w decryptage l typpo
                if (s == dt.Rows[i][1].ToString())
                {
                    DataRow[] dr = dt2.Select("(([user] = '" + CryptageEtHachage.HashPasswordsAndScores(dt.Rows[i][0].ToString()) + "'))");
                    z = CryptageEtHachage.Combine(dr[0]["Type"].ToString());
                    q2.Enqueue(dt.Rows[i][2].ToString()); z = "Prof"; a2.Enqueue(z + " " + dt.Rows[i][0].ToString());
                }                                                                                                      //dt.Rows[i][0].ToString()  //////////same
                i++;
            }
        }
        private void btnconf_Click(object sender, EventArgs e)
        {
            //check for nom textbox if empty or not
            if (NomTxt.Text == "" || NomTxt.Text == "Votre nom")
            {
                wrongnom.Visible = true;
            }
            else
            {
                wrongnom.Visible = false;
            }

            //check for user textbox if empty or not

            if (usertxt.Text == "" || usertxt.Text == "Nom utilisateur")
            {
                wronguser.Visible = true;
            }
            else
            {
                wronguser.Visible = false;
            }

            //check for password textbox if empty or not

            if (PassTxt.Text == "" || PassTxt.Text == "Votre mot clé")
            {
                motclereg.Visible = true;
            }
            else
            {
                motclereg.Visible = false;
            }

            //check for password second time textbox if empty or not

            if (Confpass.Text == "" || Confpass.Text == "Confirmer Votre mot")
            {
                conf.Visible = true;
            }
            else
            {
                conf.Visible = false;
            }

            // check for type de l'utilisateur
            if ((radioBtnEleve.Checked == false) && (radioBtnProf.Checked == false))
            {
                typeq.Visible = true;
            }
            else
            {
                typeq.Visible = false;

                if (radioBtnEleve.Checked == true)
                {
                    Variables.Type = false;
                }
                else
                {
                    Variables.Type = true;
                }
            }

            //check for genre

            if ((male.Checked == false) && (femelle.Checked == false))
            {
                genreq.Visible = true;
            }
            else
            {
                genreq.Visible = false;
            }

            // il faut l'eleve de 5 ans et plus
            if (((2021 - Datepicker.Value.Year) < 5) && radioBtnEleve.Checked == true)
            {
                dateq.Visible = true;
            }

            else
            {
                if ((radioBtnEleve.Checked == false) || (radioBtnProf.Checked == false) || (male.Checked == false) || (femelle.Checked == false))
                {
                    dateq.Visible = false;

                    if ((usertxt.Text.Length > 0) && (PassTxt.Text.Length > 0) && (usertxt.Text != "Nom utilisateur") && (PassTxt.Text != "Votre mot clé"))
                    {
                        DataRow[] dr   = dt.Select("(([user] = '" + usertxt.Text + "') AND ([pass] = '" + PassTxt.Text + "'))");
                        DataRow[] deja = dt.Select("(([user] = '" + CryptageEtHachage.HashPasswordsAndScores(usertxt.Text) + "') AND ([nom] = '" + CryptageEtHachage.HashPasswordsAndScores(NomTxt.Text) + "'))");

                        if (deja.Length == 1)
                        {
                            utilisateurDeja.Visible = true;
                        }
                        else
                        {
                            utilisateurDeja.Visible = false;
                            dateq.Visible           = false;

                            DataRow dr2 = dt.NewRow();
                            dr2[0] = usertxt.Text;
                            dr2[1] = PassTxt.Text;
                            dr2[2] = NomTxt.Text;
                            dr2[3] = 2021 - Datepicker.Value.Year;

                            if (Variables.Type == false)
                            {
                                dr2[5] = "Eleve";
                            }
                            else
                            {
                                dr2[5] = "Prof";
                            }
                            if (male.Checked == true)
                            {
                                dr2[4] = "mâle";
                            }
                            else
                            {
                                dr2[4] = "femelle";
                            }

                            // set les scores = 0
                            for (int i = 6; i < 39; i++)
                            {
                                dr2[i] = 0;
                            }
                            dr2[23] = "1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1";
                            dr2[38] = 60; //metre la meilleur score 60 s dans la jeux de suites de nbss

                            dt.Rows.Add(dr2);
                            ds.WriteXml(Application.StartupPath + "\\users.xml");
                            CryptageEtHachage.HashXmlUsers(usertxt.Text, PassTxt.Text, Application.StartupPath + "\\users.xml");
                            this.ShowInTaskbar = false;


                            Variables.intro = new Introduction();


                            intro_video intro_Video = new intro_video();
                            intro_Video.Show();



                            if ((dr2[4].ToString() == "mâle") && (Variables.Type = false))
                            {
                                Variables.B = new Bitmap(Application.StartupPath + "\\Pics\\boy.png");
                                Variables.intro.userphoto.Image = Variables.B;
                            }
                            else if ((dr2[4].ToString() == "femelle") && (Variables.Type = false))
                            {
                                Variables.B = new Bitmap(Application.StartupPath + "\\Pics\\girl.png");
                                Variables.intro.userphoto.Image = Variables.B;
                            }
                            else if ((dr2[4].ToString() == "mâle") && (Variables.Type = true))
                            {
                                Variables.B = new Bitmap(Application.StartupPath + "\\Pics\\administrator_male.png");
                                Variables.intro.userphoto.Image = Variables.B;
                            }
                            else if ((dr2[4].ToString() == "femelle") && (Variables.Type = true))
                            {
                                Variables.B = new Bitmap(Application.StartupPath + "\\Pics\\woman_profile.png");
                                Variables.intro.userphoto.Image = Variables.B;
                            }

                            Variables.exSup = dr2[23].ToString().Split(',');
                            Variables.intro.userphoto.Image = Variables.B;
                            Variables.UserNom             = usertxt.Text;
                            Variables.UserPass            = PassTxt.Text;
                            Variables.intro.username.Text = Variables.UserNom;
                            this.Hide();
                        }
                    }
                    else if ((usertxt.Text.Length > 0) && (((PassTxt.Text.Length == 0) || (PassTxt.Text == "Votre mot clé")) || ((Confpass.Text.Length == 0) || (Confpass.Text == "Confirmer Votre mot"))))
                    {
                        motclereg.Visible = true;
                        conf.Visible      = true;
                        if ((PassTxt.Text != Confpass.Text))
                        {
                            wrongpass.Visible = true;
                            conf.Visible      = false;
                        }
                        else
                        {
                            wrongpass.Visible = false;
                        }
                    }
                }
            }
        }
Exemple #15
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            //zmouseClickButton.Play();

            if ((UserTxt.Text.Length > 0) && UserTxt.Text != "Votre nom d'utilisateur")
            {
                if (PassTxt.Text.Length > 0)
                {
                    dr = dt.Select("(([user] = '" + CryptageEtHachage.HashPasswordsAndScores(UserTxt.Text) + "') AND ([pass] = '" + CryptageEtHachage.HashPasswordsAndScores(PassTxt.Text) + "'))");
                }
                if (panel1.Visible == true)
                {
                    dr = dt.Select("(([user] = '" + CryptageEtHachage.HashPasswordsAndScores(UserTxt.Text) + "'))");
                    if (dr.Length == 1)
                    {
                        if (nomText.Text != dr[0]["nom"].ToString())
                        {
                            InfoFlse.Visible = true; return;
                        }
                        else
                        {
                            panel1.Visible = false;
                            PassTxt.Text   = dr[0]["pass"].ToString();
                        }
                    }
                    else
                    {
                        InfoFlse.Visible = true; return;
                    }
                }
                if (PassTxt.Text.Length < 0)
                {
                    motcle.Visible = true; return;
                }

                if (dr.Length == 1)
                {
                    Variables.intro   = new Introduction();
                    Variables.matiere = new MatiereStart();
                    intro_video intro_ = new intro_video();
                    intro_.Show();

                    if ((CryptageEtHachage.Combine(dr[0]["genre"].ToString()) == "mâle") && (CryptageEtHachage.Combine(dr[0]["Type"].ToString()) == "Eleve"))
                    {
                        Variables.B = new Bitmap(Application.StartupPath + "\\Pics\\boy.png");
                        Variables.intro.userphoto.Image = Variables.B;
                    }
                    else if ((CryptageEtHachage.Combine(dr[0]["genre"].ToString()) == "femelle") && (CryptageEtHachage.Combine(dr[0]["Type"].ToString()) == "Eleve"))
                    {
                        Variables.B = new Bitmap(Application.StartupPath + "\\Pics\\girl.png");
                        Variables.intro.userphoto.Image = Variables.B;
                    }
                    else if ((CryptageEtHachage.Combine(dr[0]["genre"].ToString()) == "mâle") && (CryptageEtHachage.Combine(dr[0]["Type"].ToString()) == "Prof"))
                    {
                        Variables.B = new Bitmap(Application.StartupPath + "\\Pics\\administrator_male.png");
                        Variables.intro.userphoto.Image = Variables.B;
                    }
                    else if ((CryptageEtHachage.Combine(dr[0]["genre"].ToString()) == "femelle") && (CryptageEtHachage.Combine(dr[0]["Type"].ToString()) == "Prof"))
                    {
                        Variables.B = new Bitmap(Application.StartupPath + "\\Pics\\woman_profile.png");
                        Variables.intro.userphoto.Image = Variables.B;
                    }



                    this.ShowInTaskbar = false;

                    Variables.exSup = dr[0]["exSupp"].ToString().Split(',');

                    Variables.UserNom             = UserTxt.Text;
                    Variables.UserPass            = PassTxt.Text;
                    Variables.intro.username.Text = Variables.UserNom;
                    this.Hide();
                }
                else
                {
                    wrongData.Visible = true;
                }
            }

            if (PassTxt.Text == "")
            {
                motcle.Visible = true;
            }
        }