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

Windows Forms Discussion :

Message Box et progressbar


Sujet :

Windows Forms

  1. #1
    Futur Membre du Club
    Homme Profil pro
    Technicien réseau
    Inscrit en
    Mai 2013
    Messages
    8
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Technicien réseau
    Secteur : Enseignement

    Informations forums :
    Inscription : Mai 2013
    Messages : 8
    Points : 7
    Points
    7
    Par défaut Message Box et progressbar
    Bonjour,

    Je souhaite faire des actions sur un nombre indéterminé de répertoires. Chaque action est mis dans un textbox. A la fin des actions sur un dossier j'incrémente la progressbar. A la fin des opérations je souhaites afficher un message.

    - récupération du nombre total de dossier à traiter,
    - initialisation de la progressbar avec le nombre total de dossier,
    -Opérations sur chaque dossier,
    - incrémentation de ma progressBar
    - A la fin des opération un message de tyype messageBox.

    Mon problème est que la messagbox apparait alors que la progressbar n'est pas arrivé au bout. J'ai l'impression que la progressbar travail en asynchrone.

    Merci

  2. #2
    Membre éprouvé
    Profil pro
    Inscrit en
    Juin 2008
    Messages
    612
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Juin 2008
    Messages : 612
    Points : 1 050
    Points
    1 050
    Par défaut
    Salut
    -----

    initialisation de la progressbar avec le nombre total de dossier
    Le problème avec un progress-bar classique, c'est justement ça: il te faut parcourir deux fois l'arborescence (donc perte de temps) juste pour savoir combien d'opérations tu auras à réaliser.

    Dans ce genre de cas de figure je préfère utiliser un progress-bar "relatif" (sans valeur pré-définie) un peu comme celui qui apparaît lors du chargement de Windows. Ainsi, on a indication des opérations réalisées mais sans indiquer où est la fin de l'opération.

    Mon problème est que la messagbox apparait alors que la progressbar n'est pas arrivé au bout.
    Le progress-bar classique s'initialise avec une valeur maxi à atteindre. Si tu as compté le nombre de répertoires et que tu as initialisé ton progress-bar avec cette valeur, il se peut, en fonction de ton code, qu'il y ait une différence de 1 entre valeur max et nombre d'opérations, un peu comme un tableau qui a 10 éléments mais dont l'index maximum vaut 9.
    Si c'est le cas, tu devrais soustraire 1 de la valeur max.
    Mais bon, sans code, ce n'est pas évident de donner LA réponse juste.

    A+
    Claude

  3. #3
    Futur Membre du Club
    Homme Profil pro
    Technicien réseau
    Inscrit en
    Mai 2013
    Messages
    8
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Technicien réseau
    Secteur : Enseignement

    Informations forums :
    Inscription : Mai 2013
    Messages : 8
    Points : 7
    Points
    7
    Par défaut
    Bonjour,

    Merci d'avoir pris le temps de me répondre mon problème n'est pas un effet de bord. En fait je souhaites afficher un message après avoir finis mes actions. Or ce message apparait alors que la progressbar bouge encore en arrière plan.

  4. #4
    Membre régulier
    Profil pro
    Inscrit en
    Août 2006
    Messages
    72
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2006
    Messages : 72
    Points : 72
    Points
    72
    Par défaut [Débutant] Message Box et progressbar
    effectivement, sans le code, cela ne va pas être facile de te répondre...

  5. #5
    Membre éprouvé
    Profil pro
    Inscrit en
    Juin 2008
    Messages
    612
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Juin 2008
    Messages : 612
    Points : 1 050
    Points
    1 050
    Par défaut
    Salut
    -----

    Merci d'avoir pris le temps de me répondre mon problème n'est pas un effet de bord. En fait je souhaites afficher un message après avoir finis mes actions. Or ce message apparait alors que la progressbar bouge encore en arrière plan.
    Si le progress-bar bouge alors que le messagebox est affiché, l'explication que je vois c'est que le progress-bar est modifié par un thread qui n'est pas le thread qui lance le messagebox. Tu as donc probablement un problème dans la gestion de tes threads, au niveau de leur synchronisation et de la détection de fin du thread secondaire.

    Mais, de nouveau, tu peux avoir procédé de plusieurs façons, et, sans le code...

    A+
    Claude

  6. #6
    Futur Membre du Club
    Homme Profil pro
    Technicien réseau
    Inscrit en
    Mai 2013
    Messages
    8
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Technicien réseau
    Secteur : Enseignement

    Informations forums :
    Inscription : Mai 2013
    Messages : 8
    Points : 7
    Points
    7
    Par défaut
    Bonjour,

    Et encore merci pour toutes vos réponses je vous fournis mon code.

    namespace ChangEnvXP7
    {


    public partial class FormMain : Form
    {

    public FormMain()
    {
    InitializeComponent();
    }

    int intTotal = 0;
    int intCpt = 0;

    /// <summary>
    /// Récupération du nombre des comptes 'strPath' à transférer.
    /// Renommage dossier "d:\utilisat\'strPath'\'aNomSsRep'\environnement" en "d:\utilisat\Modeles\'aNomSsRep'\Windows XP".
    /// Création du repertoire "d:\utilisat\'strPath'\'aNomSsRep'\environnement".
    /// Création du repertoire "d:\utilisat\'strPath'\'aNomSsRep'\environnement\Windows 7".
    /// Déplacement du dossier "d:\utilisat\'strPath'\'aNomSsRep'\Windows XP" dans le dossier"d:\utilisat\Modeles\'aNomSsRep'\environnement".
    /// bTraitSRep : raitement des sous dossier (Autres, elv).
    /// </summary>
    /// <param name="Path"></param>
    private void fTransEnv(string strPath, bool bTraitSRep)
    {
    if (Directory.Exists(strPath))
    {

    //Récupération nom répertoire.
    string[] aNomSsRep = fUser(strPath);
    string[] aNomSsRepSs;

    //MessageBox.Show(this, "Nb compte compte administrateurs : " + aNomSsRep.Length, "Aidat Toulouse Sud Muret © Calista", MessageBoxButtons.OK, MessageBoxIcon.Information);

    pgbTotal.PerformStep();

    //Initialisation de la barre de progression sous total.
    pgbSTotal.Maximum = aNomSsRep.Length;
    pgbSTotal.Minimum = 0;
    pgbSTotal.Step = 1;
    pgbSTotal.PerformStep();

    int i;
    int j = 1;
    for (i = 1; i <= aNomSsRep.Length; i++)
    {

    if (bTraitSRep)
    {
    //traitement des sous répertoires.
    aNomSsRepSs = fUser(strPath + aNomSsRep[i - 1] + @"\");
    for (j = 1; j <= aNomSsRepSs.Length; j++)
    {
    intCpt = intCpt + 1;
    this.lCompteurTotal.Text = intCpt + "/" + intTotal;

    //Modification du label "lCompteurSTotal" qui prend la valeur i (index dossier contenue dans "d:\utilisat\ADMINS")/nb total de dossiers de "d:\utilisat\ADMINS".
    this.lCompteurSTotal.Visible = true;
    this.lCompteurSTotal.Text = i + "/" + aNomSsRep.Length;
    //Les actions décrites sont effectués uniquement si il existe un dossier environnement.
    //!Directory.Exists(@"d:\utilisat\&& !Directory.Exists(@"d:\utilisat\Autres\" + aNomSsRep[i - 1] + @"\" + aNomSsRepSs[j - 1] + @"\environnement\windows xp" capitale pour eviter la création d'un nouveau dossier "windows xp" dans le dossier \environnement\windows xp"
    //Si le programme est relancé.
    if (Directory.Exists(strPath + aNomSsRep[i - 1] + @"\" + aNomSsRepSs[j - 1] + @"\environnement") && !Directory.Exists(strPath + aNomSsRep[i - 1] + @"\" + aNomSsRepSs[j - 1] + @"\environnement\windows xp"))
    {

    //Affichage du label "labelActions"
    //Affichage text dans le label "labelActions"
    this.labelActions.Visible = true;
    this.labelActions.Text= "Le dossier : " + strPath + aNomSsRep[i - 1] + @"\" + aNomSsRepSs[j - 1] + @"\environnement" + "est renommé en : " + "\n" + strPath + aNomSsRep[i - 1] + @"\" + aNomSsRepSs[j - 1] + @"\Windows xp";

    //Affichage profil concerné par les opérations dans le label lProfil.
    this.labelProfil.Text = strPath + aNomSsRep[i - 1] + @"\" + aNomSsRepSs[j - 1];

    //MessageBox.Show(this, @"Compte Autres\" + aNomSsRep[i - 1] +@"\"+ aNomSsRepSs[j - 1], "Aidat Toulouse Sud Muret © Calista", MessageBoxButtons.OK, MessageBoxIcon.Information);
    //Le dossier "'strPath'+'aNomSsRep[i - 1]'\'aNomSsRepSs[j - 1]'\environnement" est renommé en "d:\utilisat\Autres\'aNomSsRep[i - 1]'\'aNomSsRepSs[j - 1]\Windows XP".
    if (Directory.Exists(strPath + aNomSsRep[i - 1] + @"\" + aNomSsRepSs[j - 1] + @"\environnement"))
    {
    fMoveDirectory(strPath + aNomSsRep[i - 1] + @"\" + aNomSsRepSs[j - 1] + @"\environnement", strPath +aNomSsRep[i - 1] + @"\" + aNomSsRepSs[j - 1] + @"\Windows xp");
    }

    //Création du repertoire "'strPath'\'aNomSsRep[i - 1]'\'aNomSsRepSs[j - 1]'\environnement\windows 7".
    if (!Directory.Exists(strPath +aNomSsRep[i - 1] + @"\" + aNomSsRepSs[j - 1] + @"\environnement\windows 7"))
    {
    //Affichage du label "labelActions"
    //Affichage text dans le label "labelActions"
    this.labelActions.Visible = true;
    this.labelActions.Text = "Le dossier : " + strPath + aNomSsRep[i - 1] + @"\" + aNomSsRepSs[j - 1] + @"\environnement\windows 7 est créé";
    fCreateFolder(strPath + aNomSsRep[i - 1] +@"\"+ aNomSsRepSs[j - 1]+ @"\environnement\windows 7");
    }

    //Copie du dossier "'strPath'" + aNomSsRep[i - 1] +@"\"+ aNomSsRepSs[j - 1]+@"\windows xp" dans le dossier "'strPath\"Autres\" + aNomSsRep[i - 1] +@"\"+ aNomSsRepSs[j - 1]+@"\environnement"
    if (Directory.Exists(strPath + aNomSsRep[i - 1] + @"\" + aNomSsRepSs[j - 1] + @"\windows xp"))
    {
    //Affichage du label "labelActions"
    //Affichage text dans le label "labelActions"
    this.labelActions.Visible = true;
    this.labelActions.Text = "Le dossier : " + strPath+ aNomSsRep[i - 1] + @"\" + aNomSsRepSs[j - 1] + @"\windows xp est copié dans le dossier " + "\n" + strPath + aNomSsRep[i - 1] + @"\" + aNomSsRepSs[j - 1] + @"\environnement";
    fCreateFolder(strPath + aNomSsRep[i - 1] + @"\" + aNomSsRepSs[j - 1] + @"\environnement\windows 7");
    fMoveDirectory(strPath + aNomSsRep[i - 1] + @"\" + aNomSsRepSs[j - 1] + @"\windows xp", strPath + aNomSsRep[i - 1] + @"\" + aNomSsRepSs[j - 1] + @"\environnement\windows xp");
    }
    //Incrémentation de la barre de progression.
    this.pgbTotal.PerformStep();
    this.pgbSTotal.PerformStep();
    }
    }
    }
    else
    {
    //Modification du label "lCompteurTotal" qui prend la valeur incpt(index cpt total)/nb total de dossier à traiter.
    this.lCompteurTotal.Visible = true;
    intCpt = intCpt + 1;
    this.lCompteurTotal.Text = intCpt + "/" + intTotal;


    //Modification du label "lCompteurSTotal" qui prend la valeur i (index dossier contenue dans "d:\utilisat\ADMINS")/nb total de dossiers de "d:\utilisat\ADMINS".
    this.lCompteurSTotal.Visible = true;
    this.lCompteurSTotal.Text = i + "/" + aNomSsRep.Length;

    //Les actions décrites sont effectués uniquement si il existe un dossier environnement.
    //!Directory.Exists(@"d:\utilisat\'strPath'\" + aNomSsRep[i - 1] + @"\environnement\windows xp" capitale pour eviter la création d'un nouveau dossier "windows xp" dans le dossier \environnement\windows xp"
    //Si le programme est relancé.
    if (Directory.Exists(strPath + aNomSsRep[i - 1] + @"\environnement") && !Directory.Exists(strPath + aNomSsRep[i - 1] + @"\environnement\windows xp"))
    {

    //Affichage du label "labelActions"
    //Affichage text dans le label "labelActions"
    this.labelActions.Visible = true;
    this.labelActions.Text = "Le dossier : " + strPath + aNomSsRep[i - 1] + @"\environnement" + " est renommé en : " + "\n" + strPath + aNomSsRep[i - 1] + @"\Windows xp";

    //Affichage profil concerné par les opérations dans le label lProfil.
    this.labelProfil.Visible = true;
    this.labelProfil.Text = strPath + aNomSsRep[i - 1];


    //MessageBox.Show(this, @"Compte Administrateur : " + aNomSsRep[i], "Aidat Toulouse Sud Muret © Calista", MessageBoxButtons.OK, MessageBoxIcon.Information);
    //Renommage dossier "d:\utilisat\'strPath'\'aNomSsRep'\environnement" en "'strPath'\'aNomSsRep'\Windows XP".
    if (Directory.Exists(strPath + aNomSsRep[i - 1] + @"\environnement"))
    {
    fMoveDirectory(strPath +aNomSsRep[i - 1] + @"\environnement", strPath +aNomSsRep[i - 1] + @"\Windows xp");
    }
    else //compte ne possedant pas de dossier environnemnt (Compte non MAJ avec Magret, compte AD inexisant ???).
    {
    //Ajout du nom du dossier dan le fichier ErreurChgEnvXP7.txt.
    //Ouverture du fichier.

    //Ecriture dans le fichier.

    //Fermeture du fichier
    }


    //Création du repertoire "'strPath'\'aNomSsRep'\environnement\windows 7".
    if (!Directory.Exists(strPath + aNomSsRep[i - 1] + @"\environnement\windows 7"))
    {
    //Affichage du label "labelActions"
    //Affichage text dans le label "labelActions"
    this.labelActions.Visible = true;
    this.labelActions.Text = strPath + aNomSsRep[i - 1] + @"\environnement\windows 7 est créé";
    fCreateFolder(strPath + aNomSsRep[i - 1] + @"\environnement\windows 7");
    }

    //Copie du dossier "d:\utilisat\'strPath'\" + aNomSsRep[i-1] + @"\windows xp" dans le dossier "d:\utilisat\'strPath'\" + aNomSsRep[i-1] + @"\environnement"
    if (Directory.Exists(strPath + aNomSsRep[i - 1] + @"\windows xp"))
    {
    //Affichage du label "labelActions"
    //Affichage text dans le label "labelActions"
    this.labelActions.Visible = true;
    this.labelActions.Text = "Le dossier : " + strPath + aNomSsRep[i - 1] + @"\windows xp est copié dans le dossier" + "\n" + strPath + aNomSsRep[i - 1] + @"\environnement";
    fCreateFolder(strPath+ aNomSsRep[i - 1] + @"\environnement\windows 7");
    fMoveDirectory(strPath + aNomSsRep[i - 1] + @"\windows xp", strPath + aNomSsRep[i - 1] + @"\environnement\windows xp");
    }
    }

    //Incrémentation des barres de progression.
    this.pgbSTotal.PerformStep();
    this.pgbTotal.PerformStep();
    }



    }
    //this.EndInvoke(iarSTotal);
    }
    else
    {
    MessageBox.Show(this, @"Le repertoire d:\utilisat\" + strPath + " n'existe Pas", "Aidat Toulouse Sud Muret © Calista", MessageBoxButtons.OK, MessageBoxIcon.Information);
    }
    }


    /// <summary>
    /// Fonction qui retourne un tableau contenant l'ensembe des dossiers du "ParentFolder"
    /// </summary>
    /// <param name="Parentfolder"></param>
    /// <returns></returns>
    private string[] fSTDossier(string Parentfolder)
    {
    string[] aNomSsRep = fUser(Parentfolder);

    return aNomSsRep;
    }

    /// <summary>
    /// Copie le contenu du répertoire SourceDir dans destDir
    /// </summary>
    /// <param name="sourceDir"></param>
    /// <param name="destDir"></param>
    public static void fCopyDir(string sourceDir, string destDir)
    {
    DirectoryInfo dir = new DirectoryInfo(sourceDir);
    if (dir.Exists)
    {
    string realDestDir;
    if (dir.Root.Name != dir.Name)
    {
    realDestDir = Path.Combine(destDir, dir.Name);
    if (!Directory.Exists(realDestDir))
    Directory.CreateDirectory(realDestDir);
    }
    else realDestDir = destDir;
    foreach (string d in Directory.GetDirectories(sourceDir))
    fCopyDir(d, realDestDir);
    foreach (string file in Directory.GetFiles(sourceDir))
    {

    string fileNameDest = Path.Combine(realDestDir, Path.GetFileName(file));
    //if (!File.Exists(fileNameDest))

    File.Copy(file, fileNameDest, true);
    }
    }
    }

    /// <summary>
    /// Récupération du nombre de répertoire et des noms se trouvant dans le répertoire strDir.
    /// </summary>
    /// <param name="strDir"></param>
    /// <returns></returns>
    public string[] fUser(string strDir)
    {

    int i = 0;
    DirectoryInfo diRacine = new DirectoryInfo(strDir);
    //MessageBox.Show(this, "DirectoryInfo diRacine = new DirectoryInfo(strDir) ", "Aidat Toulouse Sud Muret © Calista", MessageBoxButtons.OK, MessageBoxIcon.Information);
    //Récupération des noms des répertoires contenue dans strDir.
    DirectoryInfo[] diArr = diRacine.GetDirectories();
    // MessageBox.Show(this, "DirectoryInfo[] diArr = diRacine.GetDirectories(); ", "Aidat Toulouse Sud Muret © Calista", MessageBoxButtons.OK, MessageBoxIcon.Information);
    //Rangement des noms des répertoires dans un tableau.
    string[] aNameDirectory = new string[diArr.Length];
    //MessageBox.Show(this, "diArr.Length : " + diArr.Length, "Aidat Toulouse Sud Muret © Calista", MessageBoxButtons.OK, MessageBoxIcon.Information);
    foreach (DirectoryInfo dri in diArr)
    {
    aNameDirectory[i] = dri.Name;
    //MessageBox.Show(this, "Nom : " + aNameDirectory[i], "Aidat Toulouse Sud Muret © Calista", MessageBoxButtons.OK, MessageBoxIcon.Information);
    i++;
    }

    return aNameDirectory;
    }


    /// <summary>
    /// Fonction qui crée si necessaire le répertoire "strPath".
    /// </summary>
    /// <param name="strPath"></param>
    public void fCreateFolder(string strPath)
    {
    Directory.CreateDirectory(strPath);

    }

    /// <summary>
    /// Fonction qui renomme un dossier.
    /// </summary>
    /// <param name="strPath"></param>
    public void fMoveDirectory(string strPathInit, string strPathFinal)
    {
    Directory.Move(strPathInit, strPathFinal);

    }



    /// <summary>
    /// Fonction qui permet de stopper le programme.
    /// </summary>
    public static void Kill()
    {
    System.Diagnostics.Process proc = System.Diagnostics.Process.GetProcessById(System.Diagnostics.Process.GetCurrentProcess().Id);
    proc.Kill();
    }

    /// <summary>
    /// Arrêt et sortie du programme.
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    private void buttonQuit_Click(object sender, EventArgs e)
    {
    Kill();
    }

    private void buttonTransfert_Click(object sender, EventArgs e)
    {


    //Récupération du nombre de dossier contenue dans "d:\utilisat\admins".
    intTotal = intTotal + fSTDossier(@"D:\utilisat\admins").Length;

    //Récupération du nombre de dossier contenue dans "d:\utilisat\Modeles".
    intTotal = intTotal + fSTDossier(@"D:\utilisat\Modeles").Length;

    //Récupération du nombre de dossier contenue dans "d:\utilisat\Profs".
    intTotal = intTotal + fSTDossier(@"D:\utilisat\Profs").Length;

    //Récupération du nombre de dossier contenue dans "d:\utilisat\Autres".
    string[] strSubFolderAutres = fSTDossier(@"D:\utilisat\Autres");
    int i = 0;
    for (i = 1; i <= strSubFolderAutres.Length; i++)
    {
    intTotal = intTotal + fSTDossier(@"d:\utilisat\Autres\" + strSubFolderAutres[i - 1] + @"\").Length;
    }

    //Récupération du nombre de dossier contenue dans "d:\utilisat\Autres".
    string[] strSubFolderElv = fSTDossier(@"D:\utilisat\Eleves");
    for (i = 1; i <= strSubFolderElv.Length; i++)
    {
    intTotal = intTotal + fSTDossier(@"d:\utilisat\Eleves\" + strSubFolderElv[i - 1] + @"\").Length;
    }
    //Initialisation de la barre de progression Total.
    pgbTotal.Maximum = intTotal;
    pgbTotal.Minimum = 0;
    pgbTotal.Step = 1;

    this.lCompteurTotal.Visible = true;

    //Transfert Admins.
    fTransEnv(@"d:\utilisat\admins\",false);
    MessageBox.Show("Le traitement des environnements des Administrateurs est terminé", "Aidat Toulouse Sud Muret © Calista", MessageBoxButtons.OK, MessageBoxIcon.Information);

    //Transfert Modeles.
    fTransEnv(@"d:\utilisat\Modeles\",false);
    MessageBox.Show("Le traitement des environnements des Modeles est terminé", "Aidat Toulouse Sud Muret © Calista", MessageBoxButtons.OK, MessageBoxIcon.Information);

    //Transfert Profs.
    fTransEnv(@"d:\utilisat\Profs\",false);
    MessageBox.Show("Le traitement des environnements des Profs est terminé", "Aidat Toulouse Sud Muret © Calista", MessageBoxButtons.OK, MessageBoxIcon.Information);

    //Transfert Autres.
    fTransEnv(@"d:\utilisat\Autres\", true);
    MessageBox.Show("Le traitement des environnements des Autres est terminé", "Aidat Toulouse Sud Muret © Calista", MessageBoxButtons.OK, MessageBoxIcon.Information);

    //Transfert Eleves.
    fTransEnv(@"d:\utilisat\Eleves\", true);
    MessageBox.Show("Le traitement des environnements des Eleves est terminé", "Aidat Toulouse Sud Muret © Calista", MessageBoxButtons.OK, MessageBoxIcon.Information);

  7. #7
    Membre régulier
    Profil pro
    Inscrit en
    Août 2006
    Messages
    72
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2006
    Messages : 72
    Points : 72
    Points
    72
    Par défaut vérification à faire
    Bonjour

    Je ne suis pas sûr que tu incrémentes systématiquement tes progressBar...
    j'ai remis le code dans une balise Code, c'est plus lisible
    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
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using System.IO;
     
    namespace ChangEnvXP7
    {
     
    	public partial class FormMain : Form
    	{
     
    		public FormMain( )
    		{
    			InitializeComponent( );
    		}
     
    		int intTotal = 0;
    		int intCpt = 0;
     
    		/// <summary>
    		/// Récupération du nombre des comptes 'strPath' à transférer.
    		/// Renommage dossier "d:\utilisat\'strPath'\'aNomSsRep'\environnement" en "d:\utilisat\Modeles\'aNomSsRep'\Windows XP".
    		/// Création du repertoire "d:\utilisat\'strPath'\'aNomSsRep'\environnement".
    		/// Création du repertoire "d:\utilisat\'strPath'\'aNomSsRep'\environnement\Windows 7".
    		/// Déplacement du dossier "d:\utilisat\'strPath'\'aNomSsRep'\Windows XP" dans le dossier"d:\utilisat\Modeles\'aNomSsRep'\environnement".
    		/// bTraitSRep : raitement des sous dossier (Autres, elv).
    		/// </summary>
    		/// <param name="Path"></param>
    		private void fTransEnv( string strPath, bool bTraitSRep )
    		{
    			if ( Directory.Exists( strPath ) )
    			{
     
    				//Récupération nom répertoire.
    				string [ ] aNomSsRep = fUser( strPath );
    				string [ ] aNomSsRepSs;
     
    				//MessageBox.Show(this, "Nb compte compte administrateurs : " + aNomSsRep.Length, "Aidat Toulouse Sud Muret © Calista", MessageBoxButtons.OK, MessageBoxIcon.Information);
     
    				pgbTotal.PerformStep( );
     
    				//Initialisation de la barre de progression sous total.
    				pgbSTotal.Maximum = aNomSsRep.Length;
    				pgbSTotal.Minimum = 0;
    				pgbSTotal.Step = 1;
    				pgbSTotal.PerformStep( );
     
    				int i;
    				int j = 1;
    				for ( i = 1 ; i <= aNomSsRep.Length ; i++ )
    				{
     
    					if ( bTraitSRep )
    					{
    						//traitement des sous répertoires.
    						aNomSsRepSs = fUser( strPath + aNomSsRep [ i - 1 ] + @"\" );
    						for ( j = 1 ; j <= aNomSsRepSs.Length ; j++ )
    						{
    							intCpt = intCpt + 1;
    							this.lCompteurTotal.Text = intCpt + "/" + intTotal;
     
    							//Modification du label "lCompteurSTotal" qui prend la valeur i (index dossier contenue dans "d:\utilisat\ADMINS")/nb total de dossiers de "d:\utilisat\ADMINS".
    							this.lCompteurSTotal.Visible = true;
    							this.lCompteurSTotal.Text = i + "/" + aNomSsRep.Length;
    							//Les actions décrites sont effectués uniquement si il existe un dossier environnement.
    							//!Directory.Exists(@"d:\utilisat\&& !Directory.Exists(@"d:\utilisat\Autres\" + aNomSsRep[i - 1] + @"\" + aNomSsRepSs[j - 1] + @"\environnement\windows xp" capitale pour eviter la création d'un nouveau dossier "windows xp" dans le dossier \environnement\windows xp"
    							//Si le programme est relancé.
    							if ( Directory.Exists( strPath + aNomSsRep [ i - 1 ] + @"\" + aNomSsRepSs [ j - 1 ] + @"\environnement" ) && !Directory.Exists( strPath + aNomSsRep [ i - 1 ] + @"\" + aNomSsRepSs [ j - 1 ] + @"\environnement\windows xp" ) )
    							{
     
    								//Affichage du label "labelActions"
    								//Affichage text dans le label "labelActions"
    								this.labelActions.Visible = true;
    								this.labelActions.Text = "Le dossier : " + strPath + aNomSsRep [ i - 1 ] + @"\" + aNomSsRepSs [ j - 1 ] + @"\environnement" + "est renommé en : " + "\n" + strPath + aNomSsRep [ i - 1 ] + @"\" + aNomSsRepSs [ j - 1 ] + @"\Windows xp";
     
    								//Affichage profil concerné par les opérations dans le label lProfil.
    								this.labelProfil.Text = strPath + aNomSsRep [ i - 1 ] + @"\" + aNomSsRepSs [ j - 1 ];
     
    								//MessageBox.Show(this, @"Compte Autres\" + aNomSsRep[i - 1] +@"\"+ aNomSsRepSs[j - 1], "Aidat Toulouse Sud Muret © Calista", MessageBoxButtons.OK, MessageBoxIcon.Information);
    								//Le dossier "'strPath'+'aNomSsRep[i - 1]'\'aNomSsRepSs[j - 1]'\environnement" est renommé en "d:\utilisat\Autres\'aNomSsRep[i - 1]'\'aNomSsRepSs[j - 1]\Windows XP".
    								if ( Directory.Exists( strPath + aNomSsRep [ i - 1 ] + @"\" + aNomSsRepSs [ j - 1 ] + @"\environnement" ) )
    								{
                                                                            fMoveDirectory( strPath + aNomSsRep [ i - 1 ] + @"\" + aNomSsRepSs [ j - 1 ] + @"\environnement", strPath + aNomSsRep [ i - 1 ] + @"\" + aNomSsRepSs [ j - 1 ] + @"\Windows xp" );
                                                                    }
     
    								//Création du repertoire "'strPath'\'aNomSsRep[i - 1]'\'aNomSsRepSs[j - 1]'\environnement\windows 7".
    								if ( !Directory.Exists( strPath + aNomSsRep [ i - 1 ] + @"\" + aNomSsRepSs [ j - 1 ] + @"\environnement\windows 7" ) )
    								{
                                                                            //Affichage du label "labelActions"
                                                                            //Affichage text dans le label "labelActions"
                                                                            this.labelActions.Visible = true;
                                                                            this.labelActions.Text = "Le dossier : " + strPath + aNomSsRep [ i - 1 ] + @"\" + aNomSsRepSs [ j - 1 ] + @"\environnement\windows 7 est créé";
                                                                            fCreateFolder( strPath + aNomSsRep [ i - 1 ] + @"\" + aNomSsRepSs [ j - 1 ] + @"\environnement\windows 7" );
                                                                    }
     
    								//Copie du dossier "'strPath'" + aNomSsRep[i - 1] +@"\"+ aNomSsRepSs[j - 1]+@"\windows xp" dans le dossier "'strPath\"Autres\" + aNomSsRep[i - 1] +@"\"+ aNomSsRepSs[j - 1]+@"\environnement"
    								if ( Directory.Exists( strPath + aNomSsRep [ i - 1 ] + @"\" + aNomSsRepSs [ j - 1 ] + @"\windows xp" ) )
    								{
                                                                            //Affichage du label "labelActions"
                                                                            //Affichage text dans le label "labelActions"
                                                                            this.labelActions.Visible = true;
                                                                            this.labelActions.Text = "Le dossier : " + strPath + aNomSsRep [ i - 1 ] + @"\" + aNomSsRepSs [ j - 1 ] + @"\windows xp est copié dans le dossier " + "\n" + strPath + aNomSsRep [ i - 1 ] + @"\" + aNomSsRepSs [ j - 1 ] + @"\environnement";
                                                                            fCreateFolder( strPath + aNomSsRep [ i - 1 ] + @"\" + aNomSsRepSs [ j - 1 ] + @"\environnement\windows 7" );
                                                                            fMoveDirectory( strPath + aNomSsRep [ i - 1 ] + @"\" + aNomSsRepSs [ j - 1 ] + @"\windows xp", strPath + aNomSsRep [ i - 1 ] + @"\" + aNomSsRepSs [ j - 1 ] + @"\environnement\windows xp" );
                                                                    }
    								//Incrémentation de la barre de progression.
    								this.pgbTotal.PerformStep( );
    								this.pgbSTotal.PerformStep( );
    							}
    						}
    					}
    					else
    					{
    						//Modification du label "lCompteurTotal" qui prend la valeur incpt(index cpt total)/nb total de dossier à traiter.
    						this.lCompteurTotal.Visible = true;
    						intCpt = intCpt + 1;
    						this.lCompteurTotal.Text = intCpt + "/" + intTotal;
     
     
    						//Modification du label "lCompteurSTotal" qui prend la valeur i (index dossier contenue dans "d:\utilisat\ADMINS")/nb total de dossiers de "d:\utilisat\ADMINS".
    						this.lCompteurSTotal.Visible = true;
    						this.lCompteurSTotal.Text = i + "/" + aNomSsRep.Length;
     
    						//Les actions décrites sont effectués uniquement si il existe un dossier environnement.
    						//!Directory.Exists(@"d:\utilisat\'strPath'\" + aNomSsRep[i - 1] + @"\environnement\windows xp" capitale pour eviter la création d'un nouveau dossier "windows xp" dans le dossier \environnement\windows xp"
    						//Si le programme est relancé.
    						if ( Directory.Exists( strPath + aNomSsRep [ i - 1 ] + @"\environnement" ) && !Directory.Exists( strPath + aNomSsRep [ i - 1 ] + @"\environnement\windows xp" ) )
    						{
     
    							//Affichage du label "labelActions"
    							//Affichage text dans le label "labelActions"
    							this.labelActions.Visible = true;
    							this.labelActions.Text = "Le dossier : " + strPath + aNomSsRep [ i - 1 ] + @"\environnement" + " est renommé en : " + "\n" + strPath + aNomSsRep [ i - 1 ] + @"\Windows xp";
     
    							//Affichage profil concerné par les opérations dans le label lProfil.
    							this.labelProfil.Visible = true;
    							this.labelProfil.Text = strPath + aNomSsRep [ i - 1 ];
     
     
    							//MessageBox.Show(this, @"Compte Administrateur : " + aNomSsRep[i], "Aidat Toulouse Sud Muret © Calista", MessageBoxButtons.OK, MessageBoxIcon.Information);
    							//Renommage dossier "d:\utilisat\'strPath'\'aNomSsRep'\environnement" en "'strPath'\'aNomSsRep'\Windows XP".
    							if ( Directory.Exists( strPath + aNomSsRep [ i - 1 ] + @"\environnement" ) )
    							{
    								fMoveDirectory( strPath + aNomSsRep [ i - 1 ] + @"\environnement", strPath + aNomSsRep [ i - 1 ] + @"\Windows xp" );
    							}
    							else //compte ne possedant pas de dossier environnemnt (Compte non MAJ avec Magret, compte AD inexisant ???).
    							{
    								//Ajout du nom du dossier dan le fichier ErreurChgEnvXP7.txt.
    								//Ouverture du fichier.
     
    								//Ecriture dans le fichier.
     
    								//Fermeture du fichier
    							}
     
     
    							//Création du repertoire "'strPath'\'aNomSsRep'\environnement\windows 7".
    							if ( !Directory.Exists( strPath + aNomSsRep [ i - 1 ] + @"\environnement\windows 7" ) )
    							{
    								//Affichage du label "labelActions"
    								//Affichage text dans le label "labelActions"
    								this.labelActions.Visible = true;
    								this.labelActions.Text = strPath + aNomSsRep [ i - 1 ] + @"\environnement\windows 7 est créé";
    								fCreateFolder( strPath + aNomSsRep [ i - 1 ] + @"\environnement\windows 7" );
    							}
     
    							//Copie du dossier "d:\utilisat\'strPath'\" + aNomSsRep[i-1] + @"\windows xp" dans le dossier "d:\utilisat\'strPath'\" + aNomSsRep[i-1] + @"\environnement"
    							if ( Directory.Exists( strPath + aNomSsRep [ i - 1 ] + @"\windows xp" ) )
    							{
    								//Affichage du label "labelActions"
    								//Affichage text dans le label "labelActions"
    								this.labelActions.Visible = true;
    								this.labelActions.Text = "Le dossier : " + strPath + aNomSsRep [ i - 1 ] + @"\windows xp est copié dans le dossier" + "\n" + strPath + aNomSsRep [ i - 1 ] + @"\environnement";
    								fCreateFolder( strPath + aNomSsRep [ i - 1 ] + @"\environnement\windows 7" );
    								fMoveDirectory( strPath + aNomSsRep [ i - 1 ] + @"\windows xp", strPath + aNomSsRep [ i - 1 ] + @"\environnement\windows xp" );
    							}
    						}
     
    						//Incrémentation des barres de progression.
    						this.pgbSTotal.PerformStep( );
    						this.pgbTotal.PerformStep( );
    					}
     
     
     
    				}
    				//this.EndInvoke(iarSTotal);
    			}
    			else
    			{
    				MessageBox.Show( this, @"Le repertoire d:\utilisat\" + strPath + " n'existe Pas", "Aidat Toulouse Sud Muret © Calista", MessageBoxButtons.OK, MessageBoxIcon.Information );
    			}
    		}
     
     
    		/// <summary>
    		/// Fonction qui retourne un tableau contenant l'ensembe des dossiers du "ParentFolder"
    		/// </summary>
    		/// <param name="Parentfolder"></param>
    		/// <returns></returns>
    		private string [ ] fSTDossier( string Parentfolder )
    		{
    			string [ ] aNomSsRep = fUser( Parentfolder );
     
    			return aNomSsRep;
    		}
     
    		/// <summary>
    		/// Copie le contenu du répertoire SourceDir dans destDir
    		/// </summary>
    		/// <param name="sourceDir"></param>
    		/// <param name="destDir"></param>
    		public static void fCopyDir( string sourceDir, string destDir )
    		{
    			DirectoryInfo dir = new DirectoryInfo( sourceDir );
    			if ( dir.Exists )
    			{
    				string realDestDir;
    				if ( dir.Root.Name != dir.Name )
    				{
    					realDestDir = Path.Combine( destDir, dir.Name );
    					if ( !Directory.Exists( realDestDir ) )
    						Directory.CreateDirectory( realDestDir );
    				}
    				else
    					realDestDir = destDir;
    				foreach ( string d in Directory.GetDirectories( sourceDir ) )
    					fCopyDir( d, realDestDir );
    				foreach ( string file in Directory.GetFiles( sourceDir ) )
    				{
     
    					string fileNameDest = Path.Combine( realDestDir, Path.GetFileName( file ) );
    					//if (!File.Exists(fileNameDest))
     
    					File.Copy( file, fileNameDest, true );
    				}
    			}
    		}
     
    		/// <summary>
    		/// Récupération du nombre de répertoire et des noms se trouvant dans le répertoire strDir.
    		/// </summary>
    		/// <param name="strDir"></param>
    		/// <returns></returns>
    		public string [ ] fUser( string strDir )
    		{
     
    			int i = 0;
    			DirectoryInfo diRacine = new DirectoryInfo( strDir );
    			//MessageBox.Show(this, "DirectoryInfo diRacine = new DirectoryInfo(strDir) ", "Aidat Toulouse Sud Muret © Calista", MessageBoxButtons.OK, MessageBoxIcon.Information);
    			//Récupération des noms des répertoires contenue dans strDir.
    			DirectoryInfo [ ] diArr = diRacine.GetDirectories( );
    			// MessageBox.Show(this, "DirectoryInfo[] diArr = diRacine.GetDirectories(); ", "Aidat Toulouse Sud Muret © Calista", MessageBoxButtons.OK, MessageBoxIcon.Information);
    			//Rangement des noms des répertoires dans un tableau.
    			string [ ] aNameDirectory = new string [ diArr.Length ];
    			//MessageBox.Show(this, "diArr.Length : " + diArr.Length, "Aidat Toulouse Sud Muret © Calista", MessageBoxButtons.OK, MessageBoxIcon.Information);
    			foreach ( DirectoryInfo dri in diArr )
    			{
    				aNameDirectory [ i ] = dri.Name;
    				//MessageBox.Show(this, "Nom : " + aNameDirectory[i], "Aidat Toulouse Sud Muret © Calista", MessageBoxButtons.OK, MessageBoxIcon.Information);
    				i++;
    			}
     
    			return aNameDirectory;
    		}
     
     
    		/// <summary>
    		/// Fonction qui crée si necessaire le répertoire "strPath".
    		/// </summary>
    		/// <param name="strPath"></param>
    		public void fCreateFolder( string strPath )
    		{
    			Directory.CreateDirectory( strPath );
     
    		}
     
    		/// <summary>
    		/// Fonction qui renomme un dossier.
    		/// </summary>
    		/// <param name="strPath"></param>
    		public void fMoveDirectory( string strPathInit, string strPathFinal )
    		{
    			Directory.Move( strPathInit, strPathFinal );
     
    		}
     
     
     
    		/// <summary>
    		/// Fonction qui permet de stopper le programme.
    		/// </summary>
    		public static void Kill( )
    		{
    			System.Diagnostics.Process proc = System.Diagnostics.Process.GetProcessById( System.Diagnostics.Process.GetCurrentProcess( ).Id );
    			proc.Kill( );
    		}
     
    		/// <summary>
    		/// Arrêt et sortie du programme.
    		/// </summary>
    		/// <param name="sender"></param>
    		/// <param name="e"></param>
    		private void buttonQuit_Click( object sender, EventArgs e )
    		{
    			Kill( );
    		}
     
    		private void buttonTransfert_Click( object sender, EventArgs e )
    		{
     
     
    			//Récupération du nombre de dossier contenue dans "d:\utilisat\admins".
    			intTotal = intTotal + fSTDossier( @"D:\utilisat\admins" ).Length;
     
    			//Récupération du nombre de dossier contenue dans "d:\utilisat\Modeles".
    			intTotal = intTotal + fSTDossier( @"D:\utilisat\Modeles" ).Length;
     
    			//Récupération du nombre de dossier contenue dans "d:\utilisat\Profs".
    			intTotal = intTotal + fSTDossier( @"D:\utilisat\Profs" ).Length;
     
    			//Récupération du nombre de dossier contenue dans "d:\utilisat\Autres".
    			string [ ] strSubFolderAutres = fSTDossier( @"D:\utilisat\Autres" );
    			int i = 0;
    			for ( i = 1 ; i <= strSubFolderAutres.Length ; i++ )
    			{
    				intTotal = intTotal + fSTDossier( @"d:\utilisat\Autres\" + strSubFolderAutres [ i - 1 ] + @"\" ).Length;
    			}
     
    			//Récupération du nombre de dossier contenue dans "d:\utilisat\Autres".
    			string [ ] strSubFolderElv = fSTDossier( @"D:\utilisat\Eleves" );
    			for ( i = 1 ; i <= strSubFolderElv.Length ; i++ )
    			{
                                    intTotal = intTotal + fSTDossier( @"d:\utilisat\Eleves\" + strSubFolderElv [ i - 1 ] + @"\" ).Length;
                            }
    			//Initialisation de la barre de progression Total.
    			pgbTotal.Maximum = intTotal;
    			pgbTotal.Minimum = 0;
    			pgbTotal.Step = 1;
     
    			this.lCompteurTotal.Visible = true;
     
    			//Transfert Admins.
    			fTransEnv( @"d:\utilisat\admins\", false );
    			MessageBox.Show( "Le traitement des environnements des Administrateurs est terminé", "Aidat Toulouse Sud Muret © Calista", MessageBoxButtons.OK, MessageBoxIcon.Information );
     
    			//Transfert Modeles.
    			fTransEnv( @"d:\utilisat\Modeles\", false );
    			MessageBox.Show( "Le traitement des environnements des Modeles est terminé", "Aidat Toulouse Sud Muret © Calista", MessageBoxButtons.OK, MessageBoxIcon.Information );
     
    			//Transfert Profs.
    			fTransEnv( @"d:\utilisat\Profs\", false );
    			MessageBox.Show( "Le traitement des environnements des Profs est terminé", "Aidat Toulouse Sud Muret © Calista", MessageBoxButtons.OK, MessageBoxIcon.Information );
     
    			//Transfert Autres.
    			fTransEnv( @"d:\utilisat\Autres\", true );
    			MessageBox.Show( "Le traitement des environnements des Autres est terminé", "Aidat Toulouse Sud Muret © Calista", MessageBoxButtons.OK, MessageBoxIcon.Information );
     
    			//Transfert Eleves.
    			fTransEnv( @"d:\utilisat\Eleves\", true );
    			MessageBox.Show( "Le traitement des environnements des Eleves est terminé", "Aidat Toulouse Sud Muret © Calista", MessageBoxButtons.OK, MessageBoxIcon.Information );
    		}
    	}
    }
    L'appel à PerformStep des ProgressBar (lignes109 et 110) est conditionné par le if de la ligne 70.
    Vérifie que ce n'est pas une erreur et que ce If...(ligne 70) n'omet pas de traiter un des répertoires (et aussi le PerformStep) alors que ce répertoire est déjà compté dans ton total (dans la méthode buttonTransfert_Click).

    Si je puis me permettre, évite aussi de créer des méthodes qui font ce que font les méthodes natives (ex: fMoveDirectory, fCreateFolder), tu gagneras en clarté.
    Pense aussi à séparer la "présentation" du "métier", par exemple ne pas faire d'affichage d'info directement dans la méthode fTransEnv
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
        this.labelActions.Visible = true; 
        this.labelActions.Text = "Le d.." ;
    Utilise plutôt une méthode comme celle ci qui fera ce travail
    L'intérêt est que si tu veux en profiter pour logguer le message, afficher une MsgBox (tu le feras qu'une fois dans cette méthode sans alourdir fTransEnv())
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    private void AfficheAction(String msg)
    {
        this.labelActions.Visible = true; 
        this.labelActions.Text = msg ;
    }
    Oliv

Discussions similaires

  1. [VB.NET] - Message Box - Intercepter le bouton Aide?
    Par xVINCEx dans le forum Windows Forms
    Réponses: 14
    Dernier message: 03/06/2021, 10h51
  2. [C/C++] afficher des doubles dans une message box
    Par lalaurie40 dans le forum MFC
    Réponses: 1
    Dernier message: 24/05/2005, 14h55
  3. afficher une "message box"
    Par requiemforadream dans le forum ASP
    Réponses: 2
    Dernier message: 19/04/2005, 16h11
  4. Message box
    Par jagboys dans le forum ASP
    Réponses: 21
    Dernier message: 10/12/2004, 22h11
  5. question sur les message box !
    Par krown dans le forum Langage
    Réponses: 7
    Dernier message: 02/08/2002, 16h11

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