IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

C# Discussion :

suppression noeud xml from datagridview c#


Sujet :

C#

  1. #21
    Membre Expert
    Avatar de azstar
    Homme Profil pro
    Architecte Technique BizTalk/.NET
    Inscrit en
    Juillet 2008
    Messages
    1 198
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Canada

    Informations professionnelles :
    Activité : Architecte Technique BizTalk/.NET
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juillet 2008
    Messages : 1 198
    Par défaut
    BONJOUR
    est ce que copie est ID de video ?
    est ce que copie est unique pour chaque video?

  2. #22
    Membre averti
    Homme Profil pro
    Étudiant
    Inscrit en
    Mai 2011
    Messages
    59
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Canada

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Mai 2011
    Messages : 59
    Par défaut
    Citation Envoyé par azstar Voir le message
    BONJOUR
    est ce que copie est ID de video ?
    est ce que copie est unique pour chaque video?
    oui oui copie est unique pour chaque video

  3. #23
    Membre Expert
    Avatar de azstar
    Homme Profil pro
    Architecte Technique BizTalk/.NET
    Inscrit en
    Juillet 2008
    Messages
    1 198
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Canada

    Informations professionnelles :
    Activité : Architecte Technique BizTalk/.NET
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juillet 2008
    Messages : 1 198
    Par défaut
    essai ce code
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
     
      void supprimerParFichier()
            {
                string strFilename = "Videos.xml";
                bool blnFlag = false;
                XmlDocument objXMLDoc = new XmlDocument();
                objXMLDoc.Load(openFileDialog1.FileName);
                //XmlDocument objXMLDoc = ReadXML();
     
                XmlNodeList lstMovies = objXMLDoc.ChildNodes;
                try
                {
     
     
                    foreach (XmlNode objNode in lstMovies)
                    {
                        foreach(XmlNode moviesnode in objNode.ChildNodes)
                        {
                            XmlNodeList MovieDetaill = moviesnode.ChildNodes;
                            if (MovieDetaill[0].Name.ToUpper() == "COPIE" && MovieDetaill[0].InnerText == "d.docx")
                            {
                                objNode.RemoveChild(moviesnode);
                                blnFlag = true;
                                break;
                            }
                        }
                            if (blnFlag)
                                break;
     
                     }
     
     
                    //Save XML
                    objXMLDoc.Save(openFileDialog1.FileName+".txt");
                }
                catch (Exception j)
                {
                    MessageBox.Show(j.Message);
                }
            }

  4. #24
    Membre averti
    Homme Profil pro
    Étudiant
    Inscrit en
    Mai 2011
    Messages
    59
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Canada

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Mai 2011
    Messages : 59
    Par défaut
    Citation Envoyé par azstar Voir le message
    essai ce code
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
     
      void supprimerParFichier()
            {
                string strFilename = "Videos.xml";
                bool blnFlag = false;
                XmlDocument objXMLDoc = new XmlDocument();
                objXMLDoc.Load(openFileDialog1.FileName);
                //XmlDocument objXMLDoc = ReadXML();
     
                XmlNodeList lstMovies = objXMLDoc.ChildNodes;
                try
                {
     
     
                    foreach (XmlNode objNode in lstMovies)
                    {
                        foreach(XmlNode moviesnode in objNode.ChildNodes)
                        {
                            XmlNodeList MovieDetaill = moviesnode.ChildNodes;
                            if (MovieDetaill[0].Name.ToUpper() == "COPIE" && MovieDetaill[0].InnerText == "d.docx")
                            {
                                objNode.RemoveChild(moviesnode);
                                blnFlag = true;
                                break;
                            }
                        }
                            if (blnFlag)
                                break;
     
                     }
     
     
                    //Save XML
                    objXMLDoc.Save(openFileDialog1.FileName+".txt");
                }
                catch (Exception j)
                {
                    MessageBox.Show(j.Message);
                }
            }
    ça fonctionne pas

    voila j'ai amélioré un code mais il permet de supprimer la ligner selectionner en datagridview mais pas la supprimer en base xml :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
     
     try{
            int i= dataGridView1.SelectedCells[0].RowIndex;
            getsno = dataGridView1.Rows[i].Cells[0].Value.ToString();
     
            //string path = "Videos.xml";
            XmlDocument doc = new XmlDocument();
     
            doc.Load(Application.StartupPath + "/videos.xml");
            XmlNode node = doc.ChildNodes[0];
            MessageBox.Show("aaaaaaaaaaaaaaaaaaaa");
           // XmlNode node =doc.SelectSingleNode(dataGridView1.SelectedRows[2].Cells[2].Value.ToString());
            //this.dataGridView1.Rows.RemoveAt(this.dataGridView1.SelectedRows[0].Index);
            this.dataGridView1.Rows.RemoveAt(this.dataGridView1.SelectedRows[0].Index);
            node.ParentNode.RemoveChild(node);
            doc.Save("Videos.xml");
            MessageBox.Show("Selected Record Deleted Successfully");
            }
            catch (Exception j)
            {
                MessageBox.Show(j.Message);
            }
    Merci pour l'aide

  5. #25
    Membre Expert
    Avatar de azstar
    Homme Profil pro
    Architecte Technique BizTalk/.NET
    Inscrit en
    Juillet 2008
    Messages
    1 198
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Canada

    Informations professionnelles :
    Activité : Architecte Technique BizTalk/.NET
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juillet 2008
    Messages : 1 198
    Par défaut
    ok j'ai trouvé le problème ce lui la est bon je l'ai testé

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
     
      void supprimerParFichier()
            {
                string strFilename = "Videos.xml";
                bool blnFlag = false;
                XmlDocument objXMLDoc = new XmlDocument();
                objXMLDoc.Load(Application.StartupPath + "/videos.xml");
                //XmlDocument objXMLDoc = ReadXML();
     
                XmlNodeList lstMovies = objXMLDoc.ChildNodes;
                try
                {
     
     
                    foreach (XmlNode objNode in lstMovies)
                    {
                        foreach(XmlNode moviesnode in objNode.ChildNodes)
                        {
                            XmlNodeList MovieDetaill = moviesnode.ChildNodes;
                            foreach (XmlNode MovieDetaillsub in MovieDetaill)
                            {
                                if (MovieDetaillsub.Name.ToUpper().Equals("COPIE") && MovieDetaillsub.InnerText.Trim().Equals(dataGridView1.SelectedRows[0].Cells[0].ToString()))
                                {
                                    objNode.RemoveChild(moviesnode);
                                    blnFlag = true;
                                    break;
                                }
                            }
                        }
                            if (blnFlag)
                                break;
     
                     }
     
     
                    //Save XML
                    objXMLDoc.Save(Application.StartupPath + "/videos.xml");
                }
                catch (Exception j)
                {
                    MessageBox.Show(j.Message);
                }
            }

  6. #26
    Membre averti
    Homme Profil pro
    Étudiant
    Inscrit en
    Mai 2011
    Messages
    59
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Canada

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Mai 2011
    Messages : 59
    Par défaut
    Citation Envoyé par azstar Voir le message
    ok j'ai trouvé le problème ce lui la est bon je l'ai testé

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
     
      void supprimerParFichier()
            {
                string strFilename = "Videos.xml";
                bool blnFlag = false;
                XmlDocument objXMLDoc = new XmlDocument();
                objXMLDoc.Load(Application.StartupPath + "/videos.xml");
                //XmlDocument objXMLDoc = ReadXML();
     
                XmlNodeList lstMovies = objXMLDoc.ChildNodes;
                try
                {
     
     
                    foreach (XmlNode objNode in lstMovies)
                    {
                        foreach(XmlNode moviesnode in objNode.ChildNodes)
                        {
                            XmlNodeList MovieDetaill = moviesnode.ChildNodes;
                            foreach (XmlNode MovieDetaillsub in MovieDetaill)
                            {
                                if (MovieDetaillsub.Name.ToUpper().Equals("COPIE") && MovieDetaillsub.InnerText.Trim().Equals(dataGridView1.SelectedRows[0].Cells[0].ToString()))
                                {
                                    objNode.RemoveChild(moviesnode);
                                    blnFlag = true;
                                    break;
                                }
                            }
                        }
                            if (blnFlag)
                                break;
     
                     }
     
     
                    //Save XML
                    objXMLDoc.Save(Application.StartupPath + "/videos.xml");
                }
                catch (Exception j)
                {
                    MessageBox.Show(j.Message);
                }
            }
    ça fonctionne pas chez moi ?
    je selectionne puis je clike sur le bouton supprimer mais ça change pas !!!

  7. #27
    Membre Expert
    Avatar de azstar
    Homme Profil pro
    Architecte Technique BizTalk/.NET
    Inscrit en
    Juillet 2008
    Messages
    1 198
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Canada

    Informations professionnelles :
    Activité : Architecte Technique BizTalk/.NET
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juillet 2008
    Messages : 1 198
    Par défaut
    il faut appelle encore une fois la methode de remplir datagridview par ce que le code ne fait que supprimer depuis le fichier ne pas depuis datagridview

    tu peux ajouter
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
     
     if (blnFlag)
                        dataGridView1.Rows.Remove(dataGridView1.SelectedRows[0]);
    tu aura le code final

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
     
    void supprimerParFichier()
            {
                string strFilename = "Videos.xml";
                bool blnFlag = false;
                XmlDocument objXMLDoc = new XmlDocument();
                objXMLDoc.Load(Application.StartupPath + "/videos.xml");
                //XmlDocument objXMLDoc = ReadXML();
     
                XmlNodeList lstMovies = objXMLDoc.ChildNodes;
                try
                {
     
     
                    foreach (XmlNode objNode in lstMovies)
                    {
                        foreach(XmlNode moviesnode in objNode.ChildNodes)
                        {
                            XmlNodeList MovieDetaill = moviesnode.ChildNodes;
                            foreach (XmlNode MovieDetaillsub in MovieDetaill)
                            {
                                if (MovieDetaillsub.Name.ToUpper().Equals("COPIE") && MovieDetaillsub.InnerText.Trim().Equals(dataGridView1.SelectedRows[0].Cells[0].ToString()))
                                {
                                    objNode.RemoveChild(moviesnode);
                                    blnFlag = true;
                                    break;
                                }
                            }
                        }
                            if (blnFlag)
                                break;
     
                     }
                  if (blnFlag)
                        dataGridView1.Rows.Remove(dataGridView1.SelectedRows[0]);
     
                    //Save XML
                    objXMLDoc.Save(Application.StartupPath + "/videos.xml");
                }
                catch (Exception j)
                {
                    MessageBox.Show(j.Message);
                }
            }

  8. #28
    Membre averti
    Homme Profil pro
    Étudiant
    Inscrit en
    Mai 2011
    Messages
    59
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Canada

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Mai 2011
    Messages : 59
    Par défaut
    Citation Envoyé par azstar Voir le message
    il faut appelle encore une fois la methode de remplir datagridview par ce que le code ne fait que supprimer depuis le fichier ne pas depuis datagridview

    tu peux ajouter
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
     
     if (blnFlag)
                        dataGridView1.Rows.Remove(dataGridView1.SelectedRows[0]);
    tu aura le code final

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
     
    void supprimerParFichier()
            {
                string strFilename = "Videos.xml";
                bool blnFlag = false;
                XmlDocument objXMLDoc = new XmlDocument();
                objXMLDoc.Load(Application.StartupPath + "/videos.xml");
                //XmlDocument objXMLDoc = ReadXML();
     
                XmlNodeList lstMovies = objXMLDoc.ChildNodes;
                try
                {
     
     
                    foreach (XmlNode objNode in lstMovies)
                    {
                        foreach(XmlNode moviesnode in objNode.ChildNodes)
                        {
                            XmlNodeList MovieDetaill = moviesnode.ChildNodes;
                            foreach (XmlNode MovieDetaillsub in MovieDetaill)
                            {
                                if (MovieDetaillsub.Name.ToUpper().Equals("COPIE") && MovieDetaillsub.InnerText.Trim().Equals(dataGridView1.SelectedRows[0].Cells[0].ToString()))
                                {
                                    objNode.RemoveChild(moviesnode);
                                    blnFlag = true;
                                    break;
                                }
                            }
                        }
                            if (blnFlag)
                                break;
     
                     }
                  if (blnFlag)
                        dataGridView1.Rows.Remove(dataGridView1.SelectedRows[0]);
     
                    //Save XML
                    objXMLDoc.Save(Application.StartupPath + "/videos.xml");
                }
                catch (Exception j)
                {
                    MessageBox.Show(j.Message);
                }
            }
    étonnant !! ça fonctionne pas même après l'opération j'ouvre une autre fois le fichier xml mais pas de changement ????
    j'ai pas compris où est le problème ?
    peut être dans la ligne de récupération de l’élément sélectionnée ?

  9. #29
    Membre Expert
    Avatar de azstar
    Homme Profil pro
    Architecte Technique BizTalk/.NET
    Inscrit en
    Juillet 2008
    Messages
    1 198
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Canada

    Informations professionnelles :
    Activité : Architecte Technique BizTalk/.NET
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juillet 2008
    Messages : 1 198
    Par défaut
    tu a bien verifié dans
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    Application.StartupPath + "/videos.xml"
    tu va allez sur la ligne
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    objNode.RemoveChild(moviesnode);
    tu va cliquer sur F9 pour créer un point d'arrêt puis lance ton debug via F5
    si tu atteint le point alors le programme supprimer bien ton node

  10. #30
    Membre averti
    Homme Profil pro
    Étudiant
    Inscrit en
    Mai 2011
    Messages
    59
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Canada

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Mai 2011
    Messages : 59
    Par défaut
    Citation Envoyé par azstar Voir le message
    tu a bien verifié dans
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    Application.StartupPath + "/videos.xml"
    tu va allez sur la ligne
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    objNode.RemoveChild(moviesnode);
    tu va cliquer sur F9 pour créer un point d'arrêt puis lance ton debug via F5
    si tu atteint le point alors le programme supprimer bien ton node
    oui j'ai fait ça mais comment savoir est ce qu'il a atteind cette ligne ou nn

  11. #31
    Membre Expert
    Avatar de azstar
    Homme Profil pro
    Architecte Technique BizTalk/.NET
    Inscrit en
    Juillet 2008
    Messages
    1 198
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Canada

    Informations professionnelles :
    Activité : Architecte Technique BizTalk/.NET
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juillet 2008
    Messages : 1 198
    Par défaut
    fait ce que je t' ai dit et vérifier avant ton fichier et fait comme tu fait pour tester ton application si visual studio s’arrête dans le point d’arrêt dans ta marque avec F9

  12. #32
    Membre averti
    Homme Profil pro
    Étudiant
    Inscrit en
    Mai 2011
    Messages
    59
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Canada

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Mai 2011
    Messages : 59
    Par défaut
    Citation Envoyé par azstar Voir le message
    fait ce que je t' ai dit et vérifier avant ton fichier et fait comme tu fait pour tester ton application si visual studio s’arrête dans le point d’arrêt dans ta marque avec F9
    nn il ne s'arrete pas dans la ligne rouge
    deja j'ai fait une Messagebox.show apres la ligne pour tester.donc ne s'arete pas dans le point d'arret ????
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
     
     string strFilename = "Videos.xml";
                bool blnFlag = false;
                XmlDocument objXMLDoc = new XmlDocument();
                objXMLDoc.Load(Application.StartupPath + "/videos.xml");
                //XmlDocument objXMLDoc = ReadXML();
     
                XmlNodeList lstMovies = objXMLDoc.ChildNodes;
                try
                {
     
     
                    foreach (XmlNode objNode in lstMovies)
                    {
                        foreach (XmlNode moviesnode in objNode.ChildNodes)
                        {
                            XmlNodeList MovieDetaill = moviesnode.ChildNodes;
                            foreach (XmlNode MovieDetaillsub in MovieDetaill)
                            {
                                if (MovieDetaillsub.Name.ToUpper().Equals("COPIE") && MovieDetaillsub.InnerText.Trim().Equals(dataGridView1.SelectedRows[0].Cells[0].ToString()))
                                {
     
                                    objNode.RemoveChild(moviesnode);
                                    blnFlag = true;
                                    break;
                                }
                            }
                        }
                        if (blnFlag)
                            break;
     
                    }
                    if (blnFlag)
                        dataGridView1.Rows.Remove(dataGridView1.SelectedRows[0]);
                    MessageBox.Show("aaaa");
                    //Save XML
                    objXMLDoc.Save(Application.StartupPath + "/videos.xml");
                }
                catch (Exception j)
                {
                    MessageBox.Show(j.Message);
                }

  13. #33
    Membre Expert
    Avatar de azstar
    Homme Profil pro
    Architecte Technique BizTalk/.NET
    Inscrit en
    Juillet 2008
    Messages
    1 198
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Canada

    Informations professionnelles :
    Activité : Architecte Technique BizTalk/.NET
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juillet 2008
    Messages : 1 198
    Par défaut
    pour tant ça marche bien chez moi ;essai de debuger pour voir où réside l'erreur

  14. #34
    Membre averti
    Homme Profil pro
    Étudiant
    Inscrit en
    Mai 2011
    Messages
    59
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Canada

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Mai 2011
    Messages : 59
    Par défaut
    Citation Envoyé par azstar Voir le message
    pour tant ça marche bien chez moi ;essai de debuger pour voir où réside l'erreur
    j'ai essayer beaucoup mais pas de solution !!!!!
    est ce que tu peut m'aider par un changement de solution ??

    MErci

  15. #35
    Membre Expert
    Avatar de azstar
    Homme Profil pro
    Architecte Technique BizTalk/.NET
    Inscrit en
    Juillet 2008
    Messages
    1 198
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Canada

    Informations professionnelles :
    Activité : Architecte Technique BizTalk/.NET
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juillet 2008
    Messages : 1 198
    Par défaut
    Tu peux envoyer la form en totale pour voir !!?

  16. #36
    Membre averti
    Homme Profil pro
    Étudiant
    Inscrit en
    Mai 2011
    Messages
    59
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Canada

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Mai 2011
    Messages : 59
    Par défaut
    Citation Envoyé par azstar Voir le message
    Tu peux envoyer la form en totale pour voir !!?
    Merci azstar et voila mon code de form 2 qui contient les opération
    nom de la methode de suppression c'est: private void optionsToolStripMenuItem1_Click(object sender, EventArgs e)
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    489
    490
    491
    492
    493
    494
    495
    496
    497
    498
    499
    500
    501
    502
    503
    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    527
    528
    529
    530
    531
    532
    533
    534
    535
    536
    537
    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    565
    566
    567
    568
    569
    570
    571
    572
    573
    574
    575
    576
    577
    578
    579
    580
    581
    582
    583
    584
    585
    586
    587
    588
    589
    590
    591
    592
    593
    594
    595
    596
    597
    598
    599
    600
    601
    602
    603
    604
    605
    606
    607
    608
    609
    610
    611
    612
    613
    614
    615
    616
    617
    618
    619
    620
    621
    622
    623
    624
    625
    626
    627
    628
    629
    630
    631
    632
    633
    634
    635
    636
    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    653
    654
    655
    656
    657
    658
    659
    660
    661
    662
    663
    664
    665
    666
    667
    668
    669
    670
    671
    672
    673
    674
    675
    676
    677
    678
    679
    680
    681
    682
    683
    684
    685
    686
    687
    688
    689
    690
    691
    692
    693
    694
    695
    696
    697
    698
    699
    700
    701
    702
    703
    704
    705
    706
    707
    708
    709
    710
    711
    712
    713
    714
    715
    716
    717
    718
    719
    720
    721
    722
    723
    724
    725
    726
    727
    728
    729
    730
    731
    732
    733
    734
    735
    736
    737
    738
    739
    740
    741
    742
    743
    744
    745
    746
    747
    748
    749
    750
    751
    752
    753
    754
    755
    756
    757
    758
    759
    760
    761
    762
    763
    764
    765
    766
    767
    768
    769
    770
    771
    772
    773
    774
    775
    776
    777
    778
    779
    780
    781
    782
    783
    784
    785
    786
    787
    788
    789
    790
    791
    792
    793
    794
    795
    796
    797
    798
    799
    800
    801
    802
    803
    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    816
    817
    818
    819
    820
    821
    822
    823
    824
    825
    826
    827
    828
    829
    830
    831
    832
    833
    834
    835
    836
    837
    838
    839
    840
    841
    842
    843
    844
    845
    846
    847
    848
    849
    850
    851
    852
    853
    854
    855
    856
    857
    858
    859
    860
    861
    862
    863
    864
    865
    866
    867
    868
    869
    870
    871
    872
    873
    874
    875
    876
    877
    878
    879
    880
    881
    882
    883
    884
    885
    886
    887
    888
    889
     
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using System.IO;
    using System.Xml;
    using System.Threading;
    using System.Windows.Threading;
     
     
    namespace application_finale
    {
        public partial class Form2 :Form
        {
            //String form1.firstLine = form1.textBox1.Lines[0];
            String s = Form1.source;
            String f=Form1.firstLine;
            String cr=Form1.creat;
            String tm=Form1.tmpg;
            String cp=Form1.copie;
            String ut = Form1.util;
            String aj = Form3.txt;
            String aj2 = Form3.txt2;
            String aj3 = Form3.txt3;
            public  string text1;
            public  string text2;
            public  string text3;
     
     
            DataGridViewRow r;
            object a; EventArgs ee;
            Dictionary<string, int> d = Form1.mots;
            //Form2 frmm2 = new Form2();
     
           // String dt = getCreationTime(s).ToLongDateString();
           // String tmp = getLastAccessTime(s).ToLongTimeString();
     
            public Form2()
            {
               // object a; EventArgs ee;
                InitializeComponent();
               // threadArgs at = new threadArgs();
                //Thread th1 = new Thread(new ParameterizedThreadStart(personnaliserToolStripMenuItem1_Click));
                // th1.Start(1);
                //http://forum.lesite.fr/hfr/Programmation/CNET-managed/passer-thread-resolu-sujet_53664_1.htm
               // Thread frm2 = new Thread(new ThreadStart(startfrm2));
                //Thread th1 = new Thread(personnaliserToolStripMenuItem1_Click(a,ee));
               // th1.Start();
               // frm2.Start();
            }
            //Form2 frmm2=new Form2();
     
            public void startfrm2()    
            {
     
               // Application.Run(frmm2);
            }
            //******** thread pour lajout d element a la base**************
            public Thread Startthethread(object sender, EventArgs e)
            {
     
                var t = new Thread(() => personnaliserToolStripMenuItem1_Click(a, ee));
                t.Start();
                return t;
     
            }
            private static DateTime getCreationTime(String ss)
            {
                return File.GetCreationTime(ss);
            }
            private static DateTime getLastAccessTime(String ss)
            {
                return File.GetLastAccessTime(ss);
            }
            private void collerToolStripMenuItem_Click(object sender, EventArgs e)
            {
             /*  /* String s = Form1.source;
                String r = Form1.copie;
     
                ListViewItem lvi = new ListViewItem("r");
                lvi.SubItems.Add("s");
                lvi.SubItems.Add("ggggggg");
                lvi.SubItems.Add("gggg");
                listView1.Items.Add(lvi);
     
                listView1.View = View.Details;
                // Add a column with width 20 and left alignment.
                listView1.Columns.Add("Mots", 100, HorizontalAlignment.Left);
                listView1.Columns.Add("nbr", 80, HorizontalAlignment.Left);
                listView1.Columns.Add("aaaaaaaaaaaaaaaaa", 80, HorizontalAlignment.Left);
                string resultat = string.Empty;
                foreach (string mot in d.Keys)
                {
                    ListViewItem lv = new ListViewItem();
     
                    lv.Text = mot;
                    lv.SubItems.Add(d[mot].ToString());
                    listView1.Items.Add(lv);
                    
                }*/
     
     
     
            }
     
            private void textBox1_TextChanged(object sender, EventArgs e)
            {
     
            }
     
            private void listView1_SelectedIndexChanged(object sender, EventArgs e)
            {
     
            }
     
     
     
     
            private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
            {
     
               /* DataGridViewRow r;
                
                //DataGridView ligne;
                // this.dataGridView1.SelectedRows ligne;
                //DataGridViewRow r in dataGridView1.SelectedRows
                
                //if(DataGridViewButtonColumn.){}
     
                //dataGridView1.Refresh();
                string strFilename = "Videos.xml";
                XmlDocument xmlDoc = new XmlDocument();
     
                if (File.Exists(strFilename))
                {
                    xmlDoc.Load(strFilename);
     
                    XmlElement elmRoot = xmlDoc.DocumentElement;
                    XmlElement elmNew = xmlDoc.CreateElement("Video");
                    elmRoot.AppendChild(elmNew);
     
                    elmRoot = xmlDoc.DocumentElement;
     
                    elmNew = xmlDoc.CreateElement("FICHIER");
                    XmlText txtVideo = xmlDoc.CreateTextNode(s);
                    elmRoot.LastChild.AppendChild(elmNew);
                    elmRoot.LastChild.LastChild.AppendChild(txtVideo);
     
                    elmNew = xmlDoc.CreateElement("TITRE");
                    txtVideo = xmlDoc.CreateTextNode(f);
                    elmRoot.LastChild.AppendChild(elmNew);
                    elmRoot.LastChild.LastChild.AppendChild(txtVideo);
     
                    elmNew = xmlDoc.CreateElement("DATECREATION");
                    txtVideo = xmlDoc.CreateTextNode(cr);
                    elmRoot.LastChild.AppendChild(elmNew);
                    elmRoot.LastChild.LastChild.AppendChild(txtVideo);
     
                    elmNew = xmlDoc.CreateElement("HEUREDERNIERACCÉES");
                    txtVideo = xmlDoc.CreateTextNode(tm);
                    elmRoot.LastChild.AppendChild(elmNew);
                    elmRoot.LastChild.LastChild.AppendChild(txtVideo);
     
                    elmNew = xmlDoc.CreateElement("UTILISATEUR");
                    txtVideo = xmlDoc.CreateTextNode(ut);
                    elmRoot.LastChild.AppendChild(elmNew);
                    elmRoot.LastChild.LastChild.AppendChild(txtVideo);
     
                    elmNew = xmlDoc.CreateElement("COPIE");
                    txtVideo = xmlDoc.CreateTextNode(cp);
                    elmRoot.LastChild.AppendChild(elmNew);
                    elmRoot.LastChild.LastChild.AppendChild(txtVideo);
     
                    xmlDoc.Save(strFilename);
                    
                }
     
                Console.WriteLine();*/
     
     
                /* try
                {
                    XmlDataDocument xmldata = new XmlDataDocument();
                    xmldata.DataSet.ReadXml(Application.StartupPath + "\\ text.xml");
                    dataGridView1.DataSource = xmldata.DataSet;
                    dataGridView1.DataMember = "ENREGISTREMENT";
     
     
                }
                catch (Exception) { MessageBox.Show("Error"); }*/  
     
     
     
            }
     
            private void nouveauToolStripMenuItem1_Click(object sender, EventArgs e)
            {
               /* try
                {
                    XmlDataDocument xmldata = new XmlDataDocument();
                    xmldata.DataSet.ReadXml(Application.StartupPath + "\\Videos.xml");
                    dataGridView1.DataSource = xmldata.DataSet;
                    dataGridView1.DataMember = "Videos";
     
     
                }
                catch (Exception) { MessageBox.Show("Error"); }*/
     
               /* DataSet ds = new DataSet();
                ds.ReadXml("Videos.xml");
                dataGridView1.DataSource = ds;*/
     
     
               try
                {
                    XmlReader xmlFile;
                    xmlFile = XmlReader.Create("Videos.xml", new XmlReaderSettings());
                    DataSet ds = new DataSet();
                    ds.ReadXml(xmlFile);
                    dataGridView1.DataSource = ds.Tables[0];
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                } 
     
     
            }
     
            public void personnaliserToolStripMenuItem1_Click(object sender, EventArgs e)
            {
                //*******ajouter une nouvelle ligne**********************
                String util = System.Environment.UserName;//recupére le nom du session en cour ca veut dire le nom de l utilusateur
                String creat = getCreationTime(s).ToLongDateString();
                String creatpeti = getCreationTime(s).ToShortDateString();
                String tmpg = getCreationTime(s).ToLongTimeString();
                String tmpp = getCreationTime(s).ToShortTimeString();
                //String f;
                String c7=dataGridView1.CurrentRow.Cells[5].Value.ToString();
     
                //String c7 = dataGridView1.SelectedCells[4].Value.ToString();
                string strFilename = "Videos.xml";
                XmlDocument xmlDoc = new XmlDocument();
                try
                {
     
                    if (File.Exists(strFilename))
                    {
                        xmlDoc.Load(strFilename);
     
                        XmlElement elmRoot = xmlDoc.DocumentElement;
                        XmlElement elmNew = xmlDoc.CreateElement("Video");
                        elmRoot.AppendChild(elmNew);
     
                        elmRoot = xmlDoc.DocumentElement;
     
                        elmNew = xmlDoc.CreateElement("FICHIER");
                        XmlText txtVideo = xmlDoc.CreateTextNode(s);
                        elmRoot.LastChild.AppendChild(elmNew);
                        elmRoot.LastChild.LastChild.AppendChild(txtVideo);
     
                        elmNew = xmlDoc.CreateElement("TITRE");
                        txtVideo = xmlDoc.CreateTextNode(f);
                        elmRoot.LastChild.AppendChild(elmNew);
                        elmRoot.LastChild.LastChild.AppendChild(txtVideo);
     
                        elmNew = xmlDoc.CreateElement("DATECREATION");
                        txtVideo = xmlDoc.CreateTextNode(creat);
                        elmRoot.LastChild.AppendChild(elmNew);
                        elmRoot.LastChild.LastChild.AppendChild(txtVideo);
     
                        elmNew = xmlDoc.CreateElement("HEUREDERNIERACCÉES");
                        txtVideo = xmlDoc.CreateTextNode(creatpeti);
                        elmRoot.LastChild.AppendChild(elmNew);
                        elmRoot.LastChild.LastChild.AppendChild(txtVideo);
     
                        elmNew = xmlDoc.CreateElement("UTILISATEUR");
                        txtVideo = xmlDoc.CreateTextNode(util);
                        elmRoot.LastChild.AppendChild(elmNew);
                        elmRoot.LastChild.LastChild.AppendChild(txtVideo);
     
                        elmNew = xmlDoc.CreateElement("COPIE");
                        txtVideo = xmlDoc.CreateTextNode(c7);
                        elmRoot.LastChild.AppendChild(elmNew);
                        elmRoot.LastChild.LastChild.AppendChild(txtVideo);
     
                        xmlDoc.Save(strFilename);
     
     
                    }
                }
                catch (Exception j)
                {
                    MessageBox.Show(j.Message);
                }
     
                Console.WriteLine();
                //dataGridView1.Refresh();
     
            }
            //******************************** suite suppression***********************************
     
            //**************************************************************************
            private void optionsToolStripMenuItem1_Click(object sender, EventArgs e)
            {
     
                string strFilename = "Videos.xml";
                bool blnFlag = false;
                XmlDocument objXMLDoc = new XmlDocument();
                objXMLDoc.Load(Application.StartupPath + "/videos.xml");
                //XmlDocument objXMLDoc = ReadXML();
     
                XmlNodeList lstMovies = objXMLDoc.ChildNodes;
                try
                {
     
     
                    foreach (XmlNode objNode in lstMovies)
                    {
                        foreach (XmlNode moviesnode in objNode.ChildNodes)
                        {
                            XmlNodeList MovieDetaill = moviesnode.ChildNodes;
                            foreach (XmlNode MovieDetaillsub in MovieDetaill)
                            {
                                if (MovieDetaillsub.Name.ToUpper().Equals("COPIE") && MovieDetaillsub.InnerText.Trim().Equals(dataGridView1.SelectedRows[0].Cells[5].ToString()))
                                {
     
                                    objNode.RemoveChild(moviesnode);
                                    blnFlag = true;
                                    break;
                                }
                            }
                        }
                        if (blnFlag)
                            break;
     
                    }
                    if (blnFlag)
                        dataGridView1.Rows.Remove(dataGridView1.SelectedRows[0]);
                    MessageBox.Show("aaaa");
                    //Save XML
                    objXMLDoc.Save(Application.StartupPath + "/videos.xml");
                }
                catch (Exception j)
                {
                    MessageBox.Show(j.Message);
                }
                //***********************************************************************
               /* string strFilename = "Videos.xml";
                bool blnFlag = false;
                XmlDocument objXMLDoc = new XmlDocument();
                objXMLDoc.Load(Application.StartupPath + "/videos.xml");
                //XmlDocument objXMLDoc = ReadXML();
     
                XmlNodeList lstMovies = objXMLDoc.ChildNodes;
                try
                {
     
     
                    foreach (XmlNode objNode in lstMovies)
                    {
                        foreach (XmlNode moviesnode in objNode.ChildNodes)
                        {
                            XmlNodeList MovieDetaill = moviesnode.ChildNodes;
                            
                            if (MovieDetaill[0].InnerText == this.dataGridView1.SelectedRows[0].Cells[5].ToString())
                                MessageBox.Show("aaaa");
                            {
                                objNode.RemoveChild(moviesnode);
                                blnFlag = true;
                                break;
                            }
                        }
                        if (blnFlag)
                            break;
     
                    }
     
     
                    //Save XML
                    objXMLDoc.Save(Application.StartupPath + "/videos.xml");
                }
                catch (Exception j)
                {
                    MessageBox.Show(j.Message);
                }*/
     
                //******************************************************************
                /*  String getsno;
            try{
            int i= dataGridView1.SelectedCells[0].RowIndex;
            getsno = dataGridView1.Rows[i].Cells[0].Value.ToString();
     
            //string path = "Videos.xml";
            XmlDocument doc = new XmlDocument();
            
            doc.Load(Application.StartupPath + "/videos.xml");
            XmlNode node = doc.ChildNodes[0];
            MessageBox.Show("aaaaaaaaaaaaaaaaaaaa");
           // XmlNode node =doc.SelectSingleNode(dataGridView1.SelectedRows[2].Cells[2].Value.ToString());
            //this.dataGridView1.Rows.RemoveAt(this.dataGridView1.SelectedRows[0].Index);
            this.dataGridView1.Rows.RemoveAt(this.dataGridView1.SelectedRows[0].Index);
            node.ParentNode.RemoveChild(node);
            doc.Save("Videos.xml");
            MessageBox.Show("Selected Record Deleted Successfully");
            }
            catch (Exception j)
            {
                MessageBox.Show(j.Message);
            }*/
     
                //***************************** METHODE *********************************
                /*string strFilename = "Videos.xml";
                bool blnFlag = false;
                XmlDocument objXMLDoc = new XmlDocument();
                objXMLDoc.Load(Application.StartupPath + "/videos.xml");
                //XmlDocument objXMLDoc = ReadXML();
     
                XmlNodeList lstMovies = objXMLDoc.ChildNodes;
                try
                {
     
                    foreach (XmlNode objNode in lstMovies)
                    {
                        //XmlNodeList objNodeList = objNode.ChildNodes; 
                        XmlNode objNodeList = objNode.ChildNodes[1];
     
                        foreach (XmlNode objInnerNode in objNodeList)
                        {
                            if (objInnerNode.Value != null)
                            {
                                
                                if (objInnerNode.Value.ToString() == dataGridView1.SelectedRows[0].Cells[0].ToString())
                                {
                                    objXMLDoc.RemoveChild(objNode);
     
                                    blnFlag = true;
                                    break;
                                }
                            }
                        }
                        if (blnFlag)
                            break;
                    }
                    //Save XML
                    objXMLDoc.Save(strFilename);
                }
                catch (Exception j)
                {
                    MessageBox.Show(j.Message);
                }*/
     
                //************************************************************
               /*String Io;
                try{
                DialogResult dr;
                dr=MessageBox.Show("Voulez vous vraiment supprimer cet element","Attention",MessageBoxButtons.YesNo,MessageBoxIcon.Information);
                if (dr == DialogResult.No)
                {
                    return;
                }
                else
                {
                    Io = (dataGridView1.SelectedRows[0].Cells[0].ToString());
                    XmlDocument Doc = new XmlDocument();
                    Doc.Load(Application.StartupPath + "\\Videos.xml");
                    XmlNode Node = Doc.SelectSingleNode("copie" + Io);
                    if (Node != null)
                    {
                        Doc.DocumentElement.RemoveChild(Node);
                        MessageBox.Show("suppression réeussite", "suppression", MessageBoxButtons.OK);
                    }
                    else { }
                    Doc.Save(Application.StartupPath + "\\Videos.xml");
                }
                }
                     catch (Exception j)
            {
                MessageBox.Show(j.Message);
            }*/
     
     
     
                //******************************* methoded*********************
                /*DataGridViewCellEventArgs a;
                if (a.RowIndex != -1)
                {
     
                    //For Deleting following code
                    if (a.ColumnIndex == 0)
                    {
                        DataGridViewRow row = dataGridView1.Rows[a.RowIndex];
                        string acnum = row.Cells[3].Value.ToString();
                        string path = "Videos.xml";
                        XmlDocument doc = new XmlDocument();
                        doc.Load(path);
                        XmlNode node = doc.SelectSingleNode("/BankAccount_Details/BankAccount[AccountNumber='" + acnum + "']");
                        node.ParentNode.RemoveChild(node);
                        doc.Save(path);
                        MessageBox.Show("Selected Record Deleted Successfully");
                    }*/
                }
     
                /*******************methode autre*********************
                string strFilename = "Videos.xml";
                XmlDocument doc = new XmlDocument();
                doc.Load("Videos.xml");
                try{
                XmlNodeList rowsToDelete =
                    doc.SelectNodes("dataGridView1.SelectedRows.ToString()");
                foreach (XmlNode rowToDelete in rowsToDelete)
                    doc.DocumentElement.RemoveChild(rowToDelete);
                //Save XML
                doc.Save(strFilename);
                    }
            catch (Exception j)
            {
                MessageBox.Show(j.Message);
            }
                //*********** suppresssion methode 3*****************
               /* string strFilename = "Videos.xml";
               bool blnFlag = false;
               XmlDocument objXMLDoc = new XmlDocument();
               objXMLDoc.Load(Application.StartupPath + "/videos.xml");
            //XmlDocument objXMLDoc = ReadXML();
     
            XmlNodeList lstMovies = objXMLDoc.GetElementsByTagName("video");
            try
            {
     
                foreach (XmlNode objNode in lstMovies)
                {
                    //XmlNodeList objNodeList = objNode.ChildNodes; 
                    XmlNode objNodeList = objNode.ChildNodes[1];
                    
                    foreach (XmlNode objInnerNode in objNodeList)
                    {
                        if (objInnerNode.InnerText == dataGridView1.SelectedRows[0].Cells[0].ToString())
                        {
                            objXMLDoc.DocumentElement.RemoveChild(objNode);
     
                            blnFlag = true;
                            break;
                        }
                    }
                    if (blnFlag)
                        break;
                }
                //Save XML
                objXMLDoc.Save(strFilename);
            }
            catch (Exception j)
            {
                MessageBox.Show(j.Message);
            }*/
     
            //Display Movie List again
     
     
     
     
                //***************
               /* XmlDocument xDoc = new XmlDocument();
                xDoc.Load(Application.StartupPath + "/releve.xml");
                XmlNode rootNode = xDoc.DocumentElement;
                XmlNode childNode;
                //childNode = this.treeView1.SelectedNode;
     
                rootNode.RemoveChild(childNode);
                //rootNode.RemoveAll();                 // supprime tous les releves
                xDoc.Save(Application.StartupPath + "/releve.xml");
                //this.treeView1.SelectedNode.Remove();*/
     
     
                //*********supression autre methode ****************
                /*String c0=dataGridView1.CurrentRow.Cells[5].Value.ToString();
                String c1=dataGridView1.CurrentRow.Cells[5].Value.ToString(); 
                String c2=dataGridView1.CurrentRow.Cells[5].Value.ToString();
                String c3=dataGridView1.CurrentRow.Cells[5].Value.ToString();
                String c4=dataGridView1.CurrentRow.Cells[5].Value.ToString();
                String c5=dataGridView1.CurrentRow.Cells[5].Value.ToString();*/
     
                //String c7 = dataGridView1.SelectedCells[4].Value.ToString();
               /* string strFilename = "Videos.xml";
                XmlDocument xmlDoc = new XmlDocument();
                try
                {
     
                    if (File.Exists(strFilename))
                    {
                        xmlDoc.Load(strFilename);
                        XmlElement elmRoot = xmlDoc.DocumentElement;
                        XmlElement elmNew = xmlDoc.CreateElement("Video");
                        elmRoot.AppendChild(elmNew);
     
                        elmRoot = xmlDoc.DocumentElement;
     
                        elmNew = xmlDoc.CreateElement("FICHIER");
                        XmlText txtVideo = xmlDoc.CreateTextNode(s);
     
                        
                       
     
                        xmlDoc.Save(strFilename);
                        
     
                    }
                }
                catch (Exception j)
                {
                    MessageBox.Show(j.Message);
                }
     
                Console.WriteLine();
                dataGridView1.Refresh();*/
     
     
                //********* supprtimer une ligne methode n 2**************************
               /* string strFilename = "Videos.xml";
                XmlDocument xmlDoc = new XmlDocument();
                try
                {
     
                    if (File.Exists(strFilename))
                    {
                        xmlDoc.Load(strFilename);
     
                        // Get a reference to the root node
                        XmlElement elmRoot = xmlDoc.DocumentElement;
     
                        // Create a list of the videos
                        XmlNodeList lstVideos = xmlDoc.GetElementsByTagName("Video");
     
                        // visit each video
     
     
     
                       /* foreach (XmlNode node in lstVideos)
                        {
                            // Within a video, create a list of its children
                            XmlNodeList lstChildren = node.ChildNodes;
     
                            // Visit each child node
                            foreach (XmlNode dir in lstChildren)
                            {
                                // If the child node is Bruce Beresford
                                if (dir.InnerText.Equals(dataGridView1.SelectedRows))
                                {
                                    node.RemoveChild(dir);
     
                                    // Save the file
                                    xmlDoc.Save(strFilename);
     
                                    // Stop
                                    break;
                                }
                            }
                        }*/
                /* }
             }
             catch (Exception j)
             {
                 MessageBox.Show(j.Message);
             }
     
             Console.WriteLine();
                
     
             dataGridView1.Refresh();*/
            //***********************************************récuperer donner from form3*************************************************
             internal void populate()
            {
                String a1 = text1;
                String a2 = text2;
                String a3 = text3;
                String a4 = a1 + a2 + a3;
                //MessageBox.Show(a4);
                 //******** opération dajout***
                string strFilename = "Videos.xml";
                XmlDocument xmlDoc = new XmlDocument();
                try
                {
                    if (File.Exists(strFilename))
                    {
                        xmlDoc.Load(strFilename);
     
                        // Get a reference to the root node
                        XmlElement elmRoot = xmlDoc.DocumentElement;
     
                        // Create a list of nodes whose name is Title
                        XmlNodeList lstTitles = xmlDoc.GetElementsByTagName("FICHIER");
     
                        // visit each node named Title
                        foreach (XmlNode node in lstTitles)
                        {
                            // When you get to a node, look for the element's value
                            // If you find an element whose value is Her Alibi
                            if (node.InnerText == a3)
                            {
                                // Create an element named Category
                                XmlElement elmNew = xmlDoc.CreateElement(a1);
                                // Create the text of the new element
                                XmlText txtCatetory = xmlDoc.CreateTextNode(a2);
                                // Get a reference to the parent of the node we have found
                                XmlNode elmParent = node.ParentNode;
                                // Add the new element to the node we found
                                elmParent.AppendChild(elmNew);
                                // Specify the text of the new node
                                elmParent.LastChild.AppendChild(txtCatetory);
                                // Save the file
                                xmlDoc.Save(strFilename);
                            }
                        }
                    }
     
                    Console.WriteLine();
                }
                catch (Exception j)
                {
                    MessageBox.Show(j.Message);
                }
     
     
            }
              void ajouterUnElementToolStripMenuItem_Click(object sender, EventArgs e)
            {
               // String ajout = "";
                //string promptValue = Prompt.ShowDialog("Test", "123");
                //String promptValue = Form3.ShowDialog("Test", "123");
                Form3 frm = new Form3(this);
                frm.Show();
                //MessageBox.Show(aj);
                //*****************************ajout dun element*******************
                /*string strFilename = "Videos.xml";
                XmlDocument xmlDoc = new XmlDocument();
                try
                {
                    if (File.Exists(strFilename))
                    {
                        xmlDoc.Load(strFilename);
     
                        XmlElement elmRoot = xmlDoc.DocumentElement;
                        XmlElement elmNew = xmlDoc.CreateElement("elemet nouveauuu");
                        XmlText txtVideo = xmlDoc.CreateTextNode("Basic Instinct");
                        elmRoot.AppendChild(elmNew);
                        elmRoot.LastChild.AppendChild(txtVideo);
                        xmlDoc.Save(strFilename);
                    }
     
                    Console.WriteLine();
                    //return 0;
                }
                catch (Exception j)
                {
                    MessageBox.Show(j.Message);
                }*/
                //*********************** ajout 2*********************************
               /* string strFilename = "Videos.xml";
                XmlDocument xmlDoc = new XmlDocument();
                try
                {
                    if (File.Exists(strFilename))
                    {
                        xmlDoc.Load(strFilename);
     
                        // Get a reference to the root node
                        XmlElement elmRoot = xmlDoc.DocumentElement;
     
                        // Create a list of nodes whose name is Title
                        XmlNodeList lstTitles = xmlDoc.GetElementsByTagName("FICHIER");
     
                        // visit each node named Title
                        foreach (XmlNode node in lstTitles)
                        {
                            // When you get to a node, look for the element's value
                            // If you find an element whose value is Her Alibi
                            if (node.InnerText == "d.docx")
                            {
                                // Create an element named Category
                                XmlElement elmNew = xmlDoc.CreateElement("ak");
                                // Create the text of the new element
                                XmlText txtCatetory = xmlDoc.CreateTextNode("Comedy");
                                // Get a reference to the parent of the node we have found
                                XmlNode elmParent = node.ParentNode;
                                // Add the new element to the node we found
                                elmParent.AppendChild(elmNew);
                                // Specify the text of the new node
                                elmParent.LastChild.AppendChild(txtCatetory);
                                // Save the file
                                xmlDoc.Save(strFilename);
                            }
                        }
                    }
     
                    Console.WriteLine();
                }
                catch (Exception j)
                {
                    MessageBox.Show(j.Message);
                }*/
     
     
            }
     
            private void sommaireToolStripMenuItem1_Click(object sender, EventArgs e)
            {
                //MessageBox.Show(aj);
                //*************ajout par utilisateur****************
               /* string strNewModel = "";
                try
                {
                    Console.Write("Enter Car Model: ");
                    strNewModel = Console.ReadLine();
     
                    XmlDocument docXMLFile = new XmlDocument();
                    docXMLFile.Load("Videos.xml");
     
                    XmlElement nodRoot = docXMLFile.DocumentElement;
                    string allMyChildren = nodRoot.InnerText;
                    int indexNewModel =
                        allMyChildren.IndexOf("Video");
     
                    if (indexNewModel >= 0)
                        return;
                    else
                    {
                        XmlElement elmXML =
                            docXMLFile.CreateElement("Model");
                        XmlText txtXML =
                            docXMLFile.CreateTextNode("strNewModel");
     
                        docXMLFile.DocumentElement.AppendChild(elmXML);
                        docXMLFile.DocumentElement.LastChild.AppendChild(txtXML);
     
                        docXMLFile.Save("Videos.xml");
                    }
                }
                catch (Exception j)
                {
                    MessageBox.Show(j.Message);
                }*/
     
     
            }
     
            private void masquerUneLigneToolStripMenuItem_Click(object sender, EventArgs e)
            {
     
            }
     
            private void supprimerUneColonneToolStripMenuItem_Click(object sender, EventArgs e)
            {
     
            }
        }
     
     
        //***************************** classe prompt*********************************
       /*public static class Prompt:Form
        {
            public static string ShowDialog(string text, string caption)
            {
                
               Public String ajout;
     
                 Form prompt = new Form();
                prompt.Width = 500;
                prompt.Height = 200;
                prompt.Text = caption;
                Label textLabel = new Label() { Left = 50, Top = 20, Text = text };
                TextBox textBox = new TextBox() { Left = 50, Top = 50, Width = 400 };
                Button confirmation = new Button() { Text = "Ok", Left = 350, Width = 100, Top = 70 };
                confirmation.Click += (sender, e) => { prompt.Close(); };
                prompt.Controls.Add(confirmation);
                prompt.Controls.Add(textLabel);
                prompt.Controls.Add(textBox);
                prompt.ShowDialog();
                ajout = textBox.Text;
                return textBox.Text;
                
            }
        }*/
     
    }
    Merci pour l'aide azstar

  17. #37
    Membre Expert
    Avatar de azstar
    Homme Profil pro
    Architecte Technique BizTalk/.NET
    Inscrit en
    Juillet 2008
    Messages
    1 198
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Canada

    Informations professionnelles :
    Activité : Architecte Technique BizTalk/.NET
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juillet 2008
    Messages : 1 198
    Par défaut
    Un exemple complet
    • remplir Datagridview apartir d'un xml
    • supprimer depuis un datagridview et xml


    NB: que le code est valide pour la dernière version xml que je t'ai envoyé.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
     
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using System.Xml;
     
    namespace WindowsFormsApplication1
    {
        public partial class Form1 : Form
        {
            List<string> DGheader = new List<string>();
            public Form1()
            {
                InitializeComponent();
            }
            string Filexml = "{0}/videos.xml";
            private void Form1_Load(object sender, EventArgs e)
            {
                Filexml = string.Format(Filexml, Application.StartupPath);
                GetInforFromXMLFILE();
                RemplirDGV( GetInforFromXMLFILE());
            }
     
            List<Dictionary<string, string>> GetInforFromXMLFILE()
            {
                List<Dictionary<string, string>> Videos = new List<Dictionary<string, string>>();
     
                XmlDocument docXMLFile = new XmlDocument();
                docXMLFile.Load(Filexml);
                XmlNodeList lstVideos = docXMLFile.GetElementsByTagName("Video");
                foreach (XmlNode nodevideo in lstVideos)
                {
                    Dictionary<string, string> video = new Dictionary<string, string>();
                    foreach (XmlNode nodedetatil in nodevideo.ChildNodes)
                    {
                        if (!DGheader.Contains(nodedetatil.Name))//pour remplir entete de datagridview
                            DGheader.Add(nodedetatil.Name);
                        if (!video.ContainsKey(nodedetatil.Name))
                            video.Add(nodedetatil.Name, nodedetatil.InnerText);
                    }
                    Videos.Add(video);
                }
     
                return Videos;
            }
     
            void RemplirDGV( List<Dictionary<string, string>> data)
            {
               //Remplir DGview Header
                foreach (string HD in DGheader)
                {
                    dataGridView1.Columns.Add(HD, HD);
                }
     
     
                for (int j = 0; j < data.Count;j++ )
                {
                    Dictionary<string, string> dic = data[j];
                    DataGridViewRow row = new DataGridViewRow();
                    dataGridView1.Rows.Add(row);
                    for (int i = 0; i < DGheader.Count; i++)
                    {
                        if (dic.ContainsKey(DGheader[i]))
                            dataGridView1.Rows[j].Cells[i].Value = dic[DGheader[i]];
                    }
     
                }
     
     
            }
     
            private void button1_Click(object sender, EventArgs e)
            {
                supprimerParFichier(dataGridView1.SelectedRows[0].Index);
            }
     
     
            void supprimerParFichier(int selectindexRow)
            {
                int indexOfcopie = DGheader.IndexOf("COPIE");
                bool blnFlag = false;
                XmlDocument objXMLDoc = new XmlDocument();
                objXMLDoc.Load(Filexml);
                //XmlDocument objXMLDoc = ReadXML();
     
                XmlNodeList lstMovies = objXMLDoc.ChildNodes;
                try
                {
     
     
                    foreach (XmlNode objNode in lstMovies)
                    {
                        foreach (XmlNode moviesnode in objNode.ChildNodes)
                        {
                            XmlNodeList MovieDetaill = moviesnode.ChildNodes;
                            foreach (XmlNode MovieDetaillsub in MovieDetaill)
                            {
                                if (MovieDetaillsub.Name.ToUpper().Equals("COPIE") )
                                {
     
                                    if ( MovieDetaillsub.InnerText.Trim().Equals(dataGridView1.Rows[selectindexRow].Cells[indexOfcopie].Value.ToString()))
                                    {
                                        objNode.RemoveChild(moviesnode);
                                        blnFlag = true;
                                        break;
                                    }
                                }
                            }
                        }
                        if (blnFlag)
                            break;
     
                    }
                    if (blnFlag)
                        dataGridView1.Rows.Remove(dataGridView1.Rows[selectindexRow]);
     
                    //Save XML
                    objXMLDoc.Save(Filexml);
                }
                catch (Exception j)
                {
                    MessageBox.Show(j.Message);
                }
            }
        }
    }

  18. #38
    Membre averti
    Homme Profil pro
    Étudiant
    Inscrit en
    Mai 2011
    Messages
    59
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Canada

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Mai 2011
    Messages : 59
    Par défaut
    Citation Envoyé par azstar Voir le message
    Un exemple complet
    • remplir Datagridview apartir d'un xml
    • supprimer depuis un datagridview et xml


    NB: que le code est valide pour la dernière version xml que je t'ai envoyé.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
     
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using System.Xml;
     
    namespace WindowsFormsApplication1
    {
        public partial class Form1 : Form
        {
            List<string> DGheader = new List<string>();
            public Form1()
            {
                InitializeComponent();
            }
            string Filexml = "{0}/videos.xml";
            private void Form1_Load(object sender, EventArgs e)
            {
                Filexml = string.Format(Filexml, Application.StartupPath);
                GetInforFromXMLFILE();
                RemplirDGV( GetInforFromXMLFILE());
            }
     
            List<Dictionary<string, string>> GetInforFromXMLFILE()
            {
                List<Dictionary<string, string>> Videos = new List<Dictionary<string, string>>();
     
                XmlDocument docXMLFile = new XmlDocument();
                docXMLFile.Load(Filexml);
                XmlNodeList lstVideos = docXMLFile.GetElementsByTagName("Video");
                foreach (XmlNode nodevideo in lstVideos)
                {
                    Dictionary<string, string> video = new Dictionary<string, string>();
                    foreach (XmlNode nodedetatil in nodevideo.ChildNodes)
                    {
                        if (!DGheader.Contains(nodedetatil.Name))//pour remplir entete de datagridview
                            DGheader.Add(nodedetatil.Name);
                        if (!video.ContainsKey(nodedetatil.Name))
                            video.Add(nodedetatil.Name, nodedetatil.InnerText);
                    }
                    Videos.Add(video);
                }
     
                return Videos;
            }
     
            void RemplirDGV( List<Dictionary<string, string>> data)
            {
               //Remplir DGview Header
                foreach (string HD in DGheader)
                {
                    dataGridView1.Columns.Add(HD, HD);
                }
     
     
                for (int j = 0; j < data.Count;j++ )
                {
                    Dictionary<string, string> dic = data[j];
                    DataGridViewRow row = new DataGridViewRow();
                    dataGridView1.Rows.Add(row);
                    for (int i = 0; i < DGheader.Count; i++)
                    {
                        if (dic.ContainsKey(DGheader[i]))
                            dataGridView1.Rows[j].Cells[i].Value = dic[DGheader[i]];
                    }
     
                }
     
     
            }
     
            private void button1_Click(object sender, EventArgs e)
            {
                supprimerParFichier(dataGridView1.SelectedRows[0].Index);
            }
     
     
            void supprimerParFichier(int selectindexRow)
            {
                int indexOfcopie = DGheader.IndexOf("COPIE");
                bool blnFlag = false;
                XmlDocument objXMLDoc = new XmlDocument();
                objXMLDoc.Load(Filexml);
                //XmlDocument objXMLDoc = ReadXML();
     
                XmlNodeList lstMovies = objXMLDoc.ChildNodes;
                try
                {
     
     
                    foreach (XmlNode objNode in lstMovies)
                    {
                        foreach (XmlNode moviesnode in objNode.ChildNodes)
                        {
                            XmlNodeList MovieDetaill = moviesnode.ChildNodes;
                            foreach (XmlNode MovieDetaillsub in MovieDetaill)
                            {
                                if (MovieDetaillsub.Name.ToUpper().Equals("COPIE") )
                                {
     
                                    if ( MovieDetaillsub.InnerText.Trim().Equals(dataGridView1.Rows[selectindexRow].Cells[indexOfcopie].Value.ToString()))
                                    {
                                        objNode.RemoveChild(moviesnode);
                                        blnFlag = true;
                                        break;
                                    }
                                }
                            }
                        }
                        if (blnFlag)
                            break;
     
                    }
                    if (blnFlag)
                        dataGridView1.Rows.Remove(dataGridView1.Rows[selectindexRow]);
     
                    //Save XML
                    objXMLDoc.Save(Filexml);
                }
                catch (Exception j)
                {
                    MessageBox.Show(j.Message);
                }
            }
        }
    }
    bonjour azstar
    pour la méthode de :
    private void Form1_Load
    List<Dictionary<string, string>> GetInforFromXMLFILE()
    {
    void remlirDGV

    est ce que chaqune necessite un appel par un bouton ??
    je peut faire appel a chaqu'une dans la méthode de suppression ?

  19. #39
    Membre Expert
    Avatar de azstar
    Homme Profil pro
    Architecte Technique BizTalk/.NET
    Inscrit en
    Juillet 2008
    Messages
    1 198
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Canada

    Informations professionnelles :
    Activité : Architecte Technique BizTalk/.NET
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juillet 2008
    Messages : 1 198
    Par défaut
    bonjour

    GetInforFromXMLFILE il te renvoie les données parsées depuis ton xml.
    RemplirDGV il prend comme paramètre les données récupérées par GetInforFromXMLFILE ;il remplir la datagridview dans pour remplir la datagridview tu peux faire seulement
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
     RemplirDGV( GetInforFromXMLFILE());
    donc c'est a toi de voir si tu veux la faire dans une bouton ou bien onload form.


    et pour supprimer une ligne depuis la datagridview tu peux faire bien sur selectindexRow c'est le indice de ligne sélectionnée

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    supprimerParFichier(selectindexRow);

    tu peux supprimer la ligne GetInforFromXMLFILE() j'ai oublié de la commenter ;

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
     
     private void Form1_Load(object sender, EventArgs e)
            {
                Filexml = string.Format(Filexml, Application.StartupPath);
                //GetInforFromXMLFILE();
                RemplirDGV( GetInforFromXMLFILE());
            }

  20. #40
    Membre Expert
    Avatar de azstar
    Homme Profil pro
    Architecte Technique BizTalk/.NET
    Inscrit en
    Juillet 2008
    Messages
    1 198
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Canada

    Informations professionnelles :
    Activité : Architecte Technique BizTalk/.NET
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juillet 2008
    Messages : 1 198
    Par défaut
    un autre chose que j'ai oublie

    il faut vider la DGheader chaque fois que on fait appelle à la méthode GetInforFromXMLFILE tu peux ajouter

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    List<Dictionary<string, string>> GetInforFromXMLFILE()
            {
     DGheader.Clear();
                List<Dictionary<string, string>> Videos = new List<Dictionary<string, string>>();
     
                XmlDocument docXMLFile = new XmlDocument();
                docXMLFile.Load(Filexml);
                XmlNodeList lstVideos = docXMLFile.GetElementsByTagName("Video");
    ......
    ....
    .
    et pour
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
      Filexml = string.Format(Filexml, Application.StartupPath);
    il te construit le chemin du fichier XML (videos.xml).

Discussions similaires

  1. [Ajout noeud xml] comment ça marche?
    Par noobiewan kenobi dans le forum Format d'échange (XML, JSON...)
    Réponses: 37
    Dernier message: 19/07/2007, 22h46
  2. [XML] [DOM(XML?)] Suppression d'un noeud XML en php
    Par ribrok dans le forum Bibliothèques et frameworks
    Réponses: 1
    Dernier message: 30/01/2007, 15h11
  3. [DOM XML] Suppression de noeud XML
    Par xenoox dans le forum Bibliothèques et frameworks
    Réponses: 7
    Dernier message: 02/05/2006, 03h37
  4. Réponses: 3
    Dernier message: 01/04/2005, 09h37
  5. XSL ne parvient pas à lire les noeuds XML ??
    Par yahn dans le forum XSL/XSLT/XPATH
    Réponses: 6
    Dernier message: 27/06/2004, 19h29

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo