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
   |  
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim dir, Param, tmp, tmp1 As String
        Dim listFile(), ListeFichier, fichier, Fichier1 As Object
        Dim compte As Integer
        On Error Resume Next
        For compte = 0 To ListBox1.Items.Count - 1
            Me.Activate()
            Me.Focus()
            ListBox1.SelectedIndex = compte
            Me.Refresh()
            Delay(500)
            Label7.Text = Repertoire.Text & "\" & ListBox1.SelectedItem.ToString
            dir = Label7.Text & "\audio"
            listFile = Directory.GetFiles(dir, "*.wav")
            If listFile.Length <> 0 Then
                For Each fichier In listFile
                    Dim file As New FileInfo(fichier)
                    tmp1 = file.DirectoryName
                    If tmp1 <> tmp Then
                        tmp = tmp1
                        Param = " -convert -addfolder " & Chr(34) & dir & Chr(34) & " -format .ogg -outfolder " & Chr(34) & dir & Chr(34) & " -overwrite ALWAYS -hide"
                        Shell("C:\switch\switch.exe " & Param, AppWinStyle.NormalFocus, False)
                        Shell("C:\switch\switch.exe " & " -clear -hide", AppWinStyle.NormalFocus, True)
                    End If
                Next
                ListeFile = Nothing
            End If
        Next
        Shell("C:\switch\switch.exe " & " -hide -exit", AppWinStyle.NormalFocus, True)
        If listFile.Length <> 0 Then
            For Each fichier In listFile
                Dim file As New FileInfo(fichier)
                System.IO.File.Delete(file.DirectoryName & "\" & file.Name)
            Next
            ListeFile = Nothing
        End If
    End Sub
    Private Sub Delay(ByVal Temps As Integer) 'Ne renvoie rien
        Dim lngEndingTime As Long
        lngEndingTime = GetTickCount() + (Temps)
        Do While GetTickCount() < lngEndingTime
        Loop
    End Sub
End Class | 
Partager