Connexion
S'inscrire
Actualités
Quoi de neuf
Activités générales
Auteurs
Forums
Nouveaux messages
Rechercher un forum
Quoi de neuf
Nouveaux messages
Nouveaux messages de profil
Activités générales
Membres
Membres inscrits
Visiteurs actuels
Nouveaux messages de profil
Rechercher dans les messages des profils
Teams
Créé ton équipe
Quoi de neuf ?
Nouveaux messages
Rechercher un forum
Menu
Connexion
S'inscrire
Install the app
Install
Forums
Forums généraux
RealityGaming
Créer un logiciel pour partitionner & départitionner vos dossiers, logiciels, images ...
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Vous utilisez un navigateur non à jour ou ancien. Il ne peut pas afficher ce site ou d'autres sites correctement.
Vous devez le mettre à jour ou utiliser un
navigateur alternatif
.
Répondre à la discussion
Message
<blockquote data-quote="Paradise'" data-source="post: 3771035" data-attributes="member: 300598"><p style="text-align: center"><a href="http://reality-gaming.fr/teams/good-topic-premium.43/" target="_blank">[ATTACH=full]29219[/ATTACH] </a></p> <p style="text-align: center"></p> <p style="text-align: center"><strong><p style="text-align: center"><span style="font-family: 'Open Sans Condensed'"><span style="color: rgb(86, 133, 156)"><u>Créer un logiciel pour partitionner & départitionner vos dossiers, logiciels, images ...</u></span></span></p></p> <p style="text-align: center"></strong></p> <p style="text-align: center"><span style="font-family: 'Trebuchet MS'">Donc avant de commencé il vous faudra cette extension d'application que j'ai faite afin de vous faire <span style="color: rgb(86, 133, 156)"><strong>gagner du temps</strong></span>, elle évite d'ajouter des classes.</span></p> <p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><a href="https://mega.co.nz/#!AYxxELCA!jDo8wUQmps_gcGkXjdzF_vV0g746bLiNwqMO2NkHmCc" target="_blank">https://mega.co.nz/#!AYxxELCA!jDo8wUQmps_gcGkXjdzF_vV0g746bLiNwqMO2NkHmCc</a></span></p> <p style="text-align: center">[ATTACH=full]29220[/ATTACH]</p> <p style="text-align: center">Ensuite on passe au <span style="color: #56859C"><strong>design</strong></span> de l'application.</p> <p style="text-align: center">[ATTACH=full]29221[/ATTACH] </p> <p style="text-align: center"></p> <p style="text-align: center"><span style="font-family: 'Trebuchet MS'">Bien sur comme d'habitude il s'agit d'un exemple que je vous propose.</span></p> <p style="text-align: center"><span style="font-family: 'Trebuchet MS'">Voila la liste des items à mettre avec le nom que ils ont dans <span style="color: rgb(86, 133, 156)"><strong>mon logiciel</strong></span> donc afin que vous <span style="color: rgb(86, 133, 156)"><strong>modifier les codes</strong></span>.</span></p> <p style="text-align: center"><span style="font-family: 'Trebuchet MS'"></span></p> <p style="text-align: center"><span style="font-family: 'Trebuchet MS'">La textbox de source : txtSource</span></p> <p style="text-align: center"><span style="font-family: 'Trebuchet MS'">Le bouton de source : btnBrowseSrc</span></p> <p style="text-align: center"><span style="font-family: 'Trebuchet MS'">La textbox de destination : txtDestination</span></p> <p style="text-align: center"><span style="font-family: 'Trebuchet MS'">Le bouton de destination : btnBrowseDest</span></p> <p style="text-align: center"><span style="font-family: 'Trebuchet MS'">NuméricUpDown de File Size ( Ko ) : numUpDownFileSize</span></p> <p style="text-align: center"><span style="font-family: 'Trebuchet MS'">Le radio bouton de Partitionner : radioBtnpartitionner</span></p> <p style="text-align: center"><span style="font-family: 'Trebuchet MS'">Le radio bouton de Départitionner : radioBtndépartitionner</span></p> <p style="text-align: center"><span style="font-family: 'Trebuchet MS'">Le bouton sans texte : btn</span></p> <p style="text-align: center"><span style="font-family: 'Trebuchet MS'">Le bouton Quitter : btnExit</span></p> <p style="text-align: center"><span style="font-family: 'Trebuchet MS'">Un openFileDialog : openFileDialog1</span></p> <p style="text-align: center"><span style="font-family: 'Trebuchet MS'">Un folderBrowserDialog : folderBrowserDialog1</span></p> <p style="text-align: center"><span style="font-family: 'Trebuchet MS'">Ainsi que un statusStrip : Avec un label Ready : toolStripStatusLblStatus</span></p> <p style="text-align: center"><span style="font-family: 'Trebuchet MS'">[ATTACH=full]29222[/ATTACH] </span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'">Ensuite on va passer à la partie intéressante, le <span style="color: rgb(86, 133, 156)"><strong>codage</strong></span>.</span></p></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'">On va le faire dans l'ordre, donc on commence par : déclarer l'utilisation de l'extension.</span></p></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'">[SPOILER=CODE]</span></p></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'">using Splitter;</span></p></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'">[/SPOILER]</span></p></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"></span></p></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'">Ensuite on va mettre les deux petits bout de code pour <span style="color: rgb(86, 133, 156)"><strong>changer le texte</strong> </span>du LabelStatus.</span></p></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'">[SPOILER=CODE]</span></p></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"> private void fSplitter_CopyDone(long ms, ActionType aType)</span></p></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"> {</span></p></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"> string txt = string.Format("Finished! (Action: {0} - duration: {1:N3} sec)", aType, ms / 1000d);</span></p></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"> this.statusStrip.Invoke(new EventHandler(delegate(object o, EventArgs e) { this.toolStripStatusLblStatus.Text = txt; }));</span></p></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"> }</span></p></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"></span></p></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"> private void fSplitter_PartialCopyDone(long ms, long fileSize, long copiedSize, int partNb, ActionType aType)</span></p></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"> {</span></p></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"> string txt = string.Format("Action: {0} - Part {1}, Total duration: {2:N3} sec", aType, partNb, ms / 1000d);</span></p></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"> this.statusStrip.Invoke(new EventHandler(delegate(object o, EventArgs e) { this.toolStripStatusLblStatus.Text = txt; }));</span></p></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"> }</span></p></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'">[/SPOILER]</span></p></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'">[ATTACH=full]29223[/ATTACH] </span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'">Donc ensuite on va faire le bouton de <span style="color: rgb(86, 133, 156)"><strong>Source</strong></span> :</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'">[SPOILER=CODE]</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"> if (this.radioBtnpartitionner.Checked)</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"> {</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"> if (this.openFileDialog1.ShowDialog() == DialogResult.OK) this.txtSource.Text = this.openFileDialog1.FileName;</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"> }</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"> else</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"> {</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"> if (this.folderBrowserDialog1.ShowDialog() == DialogResult.OK) this.txtSource.Text = this.folderBrowserDialog1.SelectedPath;</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"> }</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'">[/SPOILER]</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"></span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'">Puis celui de <span style="color: rgb(86, 133, 156)"><strong>Destination</strong></span> :</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'">[SPOILER=CODE]</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"> if (this.folderBrowserDialog1.ShowDialog() == DialogResult.OK)</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"> {</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"> this.txtDestination.Text = this.folderBrowserDialog1.SelectedPath;</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"> }</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'">[/SPOILER]</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"></span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'">Ensuite on passe au code des deux radios bouton.</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'">On commence par le " <span style="color: rgb(86, 133, 156)"><strong>Partitionner</strong></span> " :</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'">[SPOILER=CODE]</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"> if (this.radioBtnpartitionner.Checked)</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"> {</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"> this.btn.Text = "Partitionner";</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"> this.txtDestination.Enabled = true;</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"> this.numUpDownFileSize.Enabled = true;</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"> }</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'">[/SPOILER]</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"></span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'">Puis le " <span style="color: rgb(86, 133, 156)"><strong>Départitionner</strong></span> "</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'">[SPOILER=CODE]</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"> if (this.radioBtndépartitionner.Checked)</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"> {</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"> this.btn.Text = "Départitionner";</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"> this.txtSource.Text = string.Empty;</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"> this.txtDestination.Enabled = false;</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"> this.numUpDownFileSize.Enabled = false;</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"> }</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'">[/SPOILER]</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"></span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'">Ensuite pour finir on met le code sur le <span style="color: rgb(86, 133, 156)"><strong>bouton ou on a mit aucun texte</strong></span>.</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'">[SPOILER=CODE]</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"> this.toolStripStatusLblStatus.Text = "Attente...";</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"> FileSplitter fSplitter = null;</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"></span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"> if (this.radioBtndépartitionner.Checked)</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"> {</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"> fSplitter = new FileSplitter(this.txtSource.Text);</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"> fSplitter.PartialCopyDone += new PartialCopyDoneEventHandler(fSplitter_PartialCopyDone);</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"> fSplitter.CopyDone += new CopyDoneEventHandler(fSplitter_CopyDone);</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"> fSplitter.BeginMerge();</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"> }</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"> else</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"> {</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"> fSplitter = new FileSplitter(this.txtSource.Text, this.txtDestination.Text, (int)(this.numUpDownFileSize.Value * 1024));</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"> fSplitter.PartialCopyDone += new PartialCopyDoneEventHandler(fSplitter_PartialCopyDone);</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"> fSplitter.CopyDone += new CopyDoneEventHandler(fSplitter_CopyDone);</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"> fSplitter.BeginSplit();</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"> }</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'">[/SPOILER]</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'">[ATTACH=full]29224[/ATTACH] </span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'">Voila ce tutoriel touche à sa fin.</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'">[ATTACH=full]29225[/ATTACH] </span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'">Je tiens à vous remerciez vous ainsi que [USER=221380]@DEVR0 GTP[/USER] pour m'avoir aider sur la création de ma première dll ( pas elle ) qui m'a appris leurs utilité, fonctionnement etc.</span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'">[ATTACH=full]29226[/ATTACH] </span></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'">Source :</span></p></span></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><a href="https://mega.co.nz/#!UJw3GT4J!Zbj0qa_5xc8pgxQ5nPgCiJNJGDWbDdSC3P5SdGTGB5g" target="_blank">https://mega.co.nz/#!UJw3GT4J!Zbj0qa_5xc8pgxQ5nPgCiJNJGDWbDdSC3P5SdGTGB5g</a></span></p></span></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><a href="http://reality-gaming.fr/teams/good-topic-premium.43/" target="_blank">[ATTACH=full]29227[/ATTACH]</a> </p></p> <p style="text-align: center"></span></p></span></span></p><p style="text-align: center"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"><span style="font-family: 'Trebuchet MS'"></span></p></p> <p style="text-align: center"></span></p></p> <p style="text-align: center"></span></p></blockquote><p></p>
[QUOTE="Paradise', post: 3771035, member: 300598"] [CENTER][URL='http://reality-gaming.fr/teams/good-topic-premium.43/'][ATTACH=full]29219[/ATTACH] [/URL] [B][CENTER][FONT=Open Sans Condensed][COLOR=rgb(86, 133, 156)][U]Créer un logiciel pour partitionner & départitionner vos dossiers, logiciels, images ...[/U][/COLOR][/FONT][/CENTER][/B] [FONT=Trebuchet MS]Donc avant de commencé il vous faudra cette extension d'application que j'ai faite afin de vous faire [COLOR=rgb(86, 133, 156)][B]gagner du temps[/B][/COLOR], elle évite d'ajouter des classes. [URL]https://mega.co.nz/#!AYxxELCA!jDo8wUQmps_gcGkXjdzF_vV0g746bLiNwqMO2NkHmCc[/URL][/FONT] [ATTACH=full]29220[/ATTACH] Ensuite on passe au [COlOR=#56859C][B]design[/B][/COLOR][B] [/B]de l'application. [ATTACH=full]29221[/ATTACH] [FONT=Trebuchet MS]Bien sur comme d'habitude il s'agit d'un exemple que je vous propose. Voila la liste des items à mettre avec le nom que ils ont dans [COLOR=rgb(86, 133, 156)][B]mon logiciel[/B][/COLOR] donc afin que vous [COLOR=rgb(86, 133, 156)][B]modifier les codes[/B][/COLOR]. La textbox de source : txtSource Le bouton de source : btnBrowseSrc La textbox de destination : txtDestination Le bouton de destination : btnBrowseDest NuméricUpDown de File Size ( Ko ) : numUpDownFileSize Le radio bouton de Partitionner : radioBtnpartitionner Le radio bouton de Départitionner : radioBtndépartitionner Le bouton sans texte : btn Le bouton Quitter : btnExit Un openFileDialog : openFileDialog1 Un folderBrowserDialog : folderBrowserDialog1 Ainsi que un statusStrip : Avec un label Ready : toolStripStatusLblStatus [ATTACH=full]29222[/ATTACH] [CENTER][FONT=Trebuchet MS]Ensuite on va passer à la partie intéressante, le [COLOR=rgb(86, 133, 156)][B]codage[/B][/COLOR]. On va le faire dans l'ordre, donc on commence par : déclarer l'utilisation de l'extension. [SPOILER=CODE] using Splitter; [/SPOILER] Ensuite on va mettre les deux petits bout de code pour [COLOR=rgb(86, 133, 156)][B]changer le texte[/B] [/COLOR]du LabelStatus. [SPOILER=CODE] private void fSplitter_CopyDone(long ms, ActionType aType) { string txt = string.Format("Finished! (Action: {0} - duration: {1:N3} sec)", aType, ms / 1000d); this.statusStrip.Invoke(new EventHandler(delegate(object o, EventArgs e) { this.toolStripStatusLblStatus.Text = txt; })); } private void fSplitter_PartialCopyDone(long ms, long fileSize, long copiedSize, int partNb, ActionType aType) { string txt = string.Format("Action: {0} - Part {1}, Total duration: {2:N3} sec", aType, partNb, ms / 1000d); this.statusStrip.Invoke(new EventHandler(delegate(object o, EventArgs e) { this.toolStripStatusLblStatus.Text = txt; })); } [/SPOILER] [ATTACH=full]29223[/ATTACH] [CENTER][FONT=Trebuchet MS]Donc ensuite on va faire le bouton de [COLOR=rgb(86, 133, 156)][B]Source[/B][/COLOR] : [SPOILER=CODE] if (this.radioBtnpartitionner.Checked) { if (this.openFileDialog1.ShowDialog() == DialogResult.OK) this.txtSource.Text = this.openFileDialog1.FileName; } else { if (this.folderBrowserDialog1.ShowDialog() == DialogResult.OK) this.txtSource.Text = this.folderBrowserDialog1.SelectedPath; } [/SPOILER] Puis celui de [COLOR=rgb(86, 133, 156)][B]Destination[/B][/COLOR] : [SPOILER=CODE] if (this.folderBrowserDialog1.ShowDialog() == DialogResult.OK) { this.txtDestination.Text = this.folderBrowserDialog1.SelectedPath; } [/SPOILER] Ensuite on passe au code des deux radios bouton. On commence par le " [COLOR=rgb(86, 133, 156)][B]Partitionner[/B][/COLOR] " : [SPOILER=CODE] if (this.radioBtnpartitionner.Checked) { this.btn.Text = "Partitionner"; this.txtDestination.Enabled = true; this.numUpDownFileSize.Enabled = true; } [/SPOILER] Puis le " [COLOR=rgb(86, 133, 156)][B]Départitionner[/B][/COLOR] " [SPOILER=CODE] if (this.radioBtndépartitionner.Checked) { this.btn.Text = "Départitionner"; this.txtSource.Text = string.Empty; this.txtDestination.Enabled = false; this.numUpDownFileSize.Enabled = false; } [/SPOILER] Ensuite pour finir on met le code sur le [COLOR=rgb(86, 133, 156)][B]bouton ou on a mit aucun texte[/B][/COLOR]. [SPOILER=CODE] this.toolStripStatusLblStatus.Text = "Attente..."; FileSplitter fSplitter = null; if (this.radioBtndépartitionner.Checked) { fSplitter = new FileSplitter(this.txtSource.Text); fSplitter.PartialCopyDone += new PartialCopyDoneEventHandler(fSplitter_PartialCopyDone); fSplitter.CopyDone += new CopyDoneEventHandler(fSplitter_CopyDone); fSplitter.BeginMerge(); } else { fSplitter = new FileSplitter(this.txtSource.Text, this.txtDestination.Text, (int)(this.numUpDownFileSize.Value * 1024)); fSplitter.PartialCopyDone += new PartialCopyDoneEventHandler(fSplitter_PartialCopyDone); fSplitter.CopyDone += new CopyDoneEventHandler(fSplitter_CopyDone); fSplitter.BeginSplit(); } [/SPOILER] [ATTACH=full]29224[/ATTACH] Voila ce tutoriel touche à sa fin. [ATTACH=full]29225[/ATTACH] Je tiens à vous remerciez vous ainsi que [USER=221380]@DEVR0 GTP[/USER] pour m'avoir aider sur la création de ma première dll ( pas elle ) qui m'a appris leurs utilité, fonctionnement etc. [ATTACH=full]29226[/ATTACH] [CENTER][FONT=Trebuchet MS]Source : [URL]https://mega.co.nz/#!UJw3GT4J!Zbj0qa_5xc8pgxQ5nPgCiJNJGDWbDdSC3P5SdGTGB5g[/URL][/FONT] [URL='http://reality-gaming.fr/teams/good-topic-premium.43/'][ATTACH=full]29227[/ATTACH][/URL] [/CENTER] [/FONT][/CENTER][/FONT][/CENTER][/FONT][/CENTER] [/QUOTE]
Insérer les citations…
Vérification
Publier la réponse
Forums
Forums généraux
RealityGaming
Créer un logiciel pour partitionner & départitionner vos dossiers, logiciels, images ...
Ce site utilise des cookies. En continuant à utiliser ce site, vous acceptez l'utilisation des cookies.
Acceptez
En savoir plus.…
Haut