[VB.NET]Crée un Converter + Pumper

    Publicités

Users Who Are Viewing This Thread (Total: 0, Members: 0, Guests: 0)

M

Membre supprimé 245833

Bonjour tout le monde ! Aujourd'hui je fais un tuto sur comment crée un Converter et un Pumper.
Difficulté: ||||||||||||||||||||
I.C'est quoi un Pumper ?
Un pumper sere à rajouter des KB à un fichier.

II.Matériel
Visual Basic Express 2010/2008 ou Visual Studio 2012
Lame.exe: Ce lien n'est pas visible, veuillez vous connecter pour l'afficher. Je m'inscris!
Brain.exe: En téléchargement en bas.

III.Design
6 Button
1 Combo Box(Avec les éléments: PNG
JPEG
GIF
BMP
ICONE)
3 TextBox
1 NumericUpDown
3 OpenFileDialog
1 SaveFileDialog
1 PictureBox
2 ProgressBar
1 RichTextBox
Design:​
Ce lien n'est pas visible, veuillez vous connecter pour l'afficher. Je m'inscris!
Petite erreur, ne faites pas attention au 2 button avec une image play et stop.
IV.Tuto
Crée un nouveau projet et renommé le:
Ce lien n'est pas visible, veuillez vous connecter pour l'afficher. Je m'inscris!
Double clique sur le premier button:
On ouvre la OpenFileDialog pour aller chercher l'image.
HTML:
  Try
            If OpenFileDialog1.ShowDialog() = DialogResult.OK Then
                Cg3TextBox1.Text = OpenFileDialog1.FileName
                PictureBox1.Image = System.Drawing.Image.FromFile(OpenFileDialog1.FileName)
            End If
        Catch ex As Exception
        End Try
Double clique sur le deuxième button:
On va convertir l'image en format voulu.
HTML:
  If ComboBox1.SelectedItem = "JPEG" Then
            Try
                SaveFileDialog1.Filter = "JPEG |*.jpeg"
                If SaveFileDialog1.ShowDialog() = DialogResult.OK Then
                    MsgBox("Fichier converti en:" & ComboBox1.SelectedItem & " avec succès !", vbInformation, "Finish")
                    PictureBox1.Image.Save(SaveFileDialog1.FileName, System.Drawing.Imaging.ImageFormat.Jpeg)
                End If
            Catch ex As Exception
            End Try
        End If
        If ComboBox1.SelectedItem = "PNG" Then
            Try
                SaveFileDialog1.Filter = "PNG |*.png"
                If SaveFileDialog1.ShowDialog() = DialogResult.OK Then
                    MsgBox("Fichier converti en:" & ComboBox1.SelectedItem & " avec succès !", vbInformation, "Finish")
                    PictureBox1.Image.Save(SaveFileDialog1.FileName, System.Drawing.Imaging.ImageFormat.Png)
                End If
            Catch ex As Exception
            End Try
        End If
        If ComboBox1.SelectedItem = "GIF" Then
            Try
                SaveFileDialog1.Filter = "GIF |*.gif"
                If SaveFileDialog1.ShowDialog() = DialogResult.OK Then
                    MsgBox("Fichier converti en:" & ComboBox1.SelectedItem & " avec succès !", vbInformation, "Finish")
                    PictureBox1.Image.Save(SaveFileDialog1.FileName, System.Drawing.Imaging.ImageFormat.Gif)
                End If
            Catch ex As Exception
            End Try
        End If
        If ComboBox1.SelectedItem = "BMP" Then
            Try
                SaveFileDialog1.Filter = "BMP |*.bmp"
                If SaveFileDialog1.ShowDialog() = DialogResult.OK Then
                    MsgBox("Fichier converti en:" & ComboBox1.SelectedItem & " avec succès !", vbInformation, "Finish")
                    PictureBox1.Image.Save(SaveFileDialog1.FileName, System.Drawing.Imaging.ImageFormat.Bmp)
                End If
            Catch ex As Exception
            End Try
        End If
        If ComboBox1.SelectedItem = "ICONE" Then
            Try
                SaveFileDialog1.Filter = "ICONE |*.ico"
                If SaveFileDialog1.ShowDialog() = DialogResult.OK Then
                    MsgBox("Fichier converti en:" & ComboBox1.SelectedItem & " avec succès !", vbInformation, "Finish")
                    PictureBox1.Image.Save(SaveFileDialog1.FileName, System.Drawing.Imaging.ImageFormat.Icon)
                End If
            Catch ex As Exception
            End Try
        End If
Double clique sur le troisième boutton:
On va ouvrir la deuxième OpenFileDialog pour aller chercher le fichier .WAV
HTML:
OpenFileDialog2.InitialDirectory = "c:\\"
        OpenFileDialog2.Filter =
          "Wav files |*.wav|All files (*.*)|*.*"
        OpenFileDialog2.FilterIndex = 1
        OpenFileDialog2.RestoreDirectory = False
        If OpenFileDialog2.ShowDialog() = DialogResult.OK Then
            'load input wav file in textbox
            Cg3TextBox2.Text = OpenFileDialog2.FileName
        End If
Double clique sur le quatrième boutton pour start le timer1:
HTML:
 Timer1.Start()
Double clique sur le timer:
On va convertir le fichier .WAV en .MP3
HTML:
  ProgressBar1.Value += 10
        If ProgressBar1.Value = 100 Then
            Timer1.Stop()
            MsgBox("Fichier WAV converti en MP3 avec succès !", vbInformation, "Terminé !")
            ProgressBar1.Value = 0
            Dim Lame As Process = New Process()
            Lame.StartInfo.FileName = "Lame.exe"
            Lame.StartInfo.Arguments = " --nohist --preset medium " + """" + Cg3TextBox2.Text
            Lame.StartInfo.CreateNoWindow = True
            Lame.StartInfo.UseShellExecute = False
            Lame.StartInfo.RedirectStandardOutput = True
            Lame.StartInfo.RedirectStandardError = True
            Lame.Start()
            While Not Lame.StandardError.EndOfStream
                RichTextBox1.Text +=
              Lame.StandardError.ReadLine() +
                              Environment.NewLine
                Application.DoEvents()
            End While
            Lame.WaitForExit()
        End If
Double clique sur le cinquième boutton:
On va ouvrir le fichier à pump.
HTML:
   If (OpenFileDialog3.ShowDialog = DialogResult.OK) Then
            Cg3TextBox3.Text = OpenFileDialog3.FileName
        End If
On double clique sur le sixième boutton:
On va rajouter les KB au fichier choisis
HTML:
 Cg3ProgressBar1.Value = 0
        Cg3ProgressBar1.Maximum = NumericUpDown1.Value
        If (Cg3TextBox3.Text = "") Then
            MsgBox("Veuillez séléctionner un fichier !", vbCritical, "Erreur")
        ElseIf (NumericUpDown1.Text = "") Then
            MsgBox("Veuillez entrez un nombre de KB !", vbCritical, "Erreur")
        Else
            Try
                Dim num As Integer = 0
                Dim num2 As Integer = 0
                Dim random As New Random
                Dim buffer As Byte() = New Byte(1 - 1) {}
                Dim stream As New FileStream(Cg3TextBox3.Text, FileMode.Append)
                num = (Integer.Parse(NumericUpDown1.Value) * &H400)
                Cg3ProgressBar1.Maximum = num
                Dim num4 As Integer = (num - 1)
                Dim i As Integer = 0
                Do While (i <= num4)
                    random.NextBytes(buffer)
                    stream.WriteByte(buffer(0))
                    num2 += 1
                    Cg3ProgressBar1.Value = num2
                    Application.DoEvents()
                    i += 1
                Loop
                stream.Close()
                MsgBox("Les KB ont été rajouté !", vbInformation, "Terminé !")
            Catch exception1 As Exception
            End Try
        End If
V.Fin
Et voilà un tuto très simple !
Maintenant à vous de créer votre Converter et votre Pumper !
Virus Scan de Lame.exe: Ce lien n'est pas visible, veuillez vous connecter pour l'afficher. Je m'inscris!
VI.Avancement des projets
Navigateur Internet V2 est presque fini !
Red Sausage Bot Dofus(Nouveau projet) est à 50%
Youtube Bot est à 75%(Un tuto sera la dessus)
ADF.LY bot est à 10% :arf:
5 Thème sont à venir dont un qui est dans l'image du design.Avancement: 1/5
 

Attachments

  • Brain.exe
    142 KB · Views: 14
Last edited by a moderator:
I

imadoooooo

C'est plutot des code sources les un après les autres :hap: Tu devrais expliquer chaque partie du code :hap:
 
M

Membre supprimé 245833

Il n'y a pas que l'image converter, et déjà, j'ai suivis aucun tuto pour faire mon tutorial ! Alors s'il vous plait ne dites pas que j'ai pris sur un autre tuto.
 
M

Membre supprimé 245833

Il y a quand même beaucoup de tutoriels similaires et :
Ce lien n'est pas visible, veuillez vous connecter pour l'afficher. Je m'inscris!
Oups, pourquoi as tu appelé ton Process "Lame"...
Là tu va me prendre pour un con et me dire oué mais là c'est du c# alors que moi c'est du vb donc j'ai pas pu suivre ce tuto ?
Tu vois j'ai jamais vu ce tuto alors. Et d'ailleurs je connais pas le C#. J'ai juste pris le fichier Lame, et qui te dis que sa vien de ce tuto ? Fin bon, sa sere à rien que je parle car de toute façon vous allez me forcer alors qu'il y a rien à savoir.
 

Evaelis

La Voix de la Sagesse
V
Ancien staff
Apr 28, 2010
22,949
468
1,699
Valhalla
Dans ce cas parlons du tutoriel en lui même :
ProgressBar1.Value += 10
If ProgressBar1.Value = 100 Then
Explique moi à quoi sert cette progressbar :/

PS : Nous ne sommes pas là pour te dégouter de faire des tutoriels, juste que faire un pumper, c'est pas vraiment inné.