Eccolo

Codice PHP:
Imports System.Media.SoundPlayer
Imports System
.IO
Imports Microsoft
.DirectX
Imports Microsoft
.DirectX.AudioVideoPlayback




Public Class Form1

    
Public oplay As Audio
    
Public ofile As String
    
    
Private Sub Button4_Click(ByVal sender As System.ObjectByVal e As System.EventArgsHandles Button4.Click
        GestisciMp3
("Play")
    
End Sub

    
Private Sub Button6_Click(ByVal sender As System.ObjectByVal e As System.EventArgsHandles Button6.Click
        GestisciMp3
("Pause")
    
End Sub

    
Private Sub Button5_Click(ByVal sender As System.ObjectByVal e As System.EventArgsHandles Button5.Click
        GestisciMp3
("Stop")
    
End Sub





    
Private Sub GestisciMp3(ByVal operation As String)
        
ofile ListBox2.Items.Item(ListBox2.SelectedIndex)
        If 
operation "Play" Then
            oplay 
= New Audio(ofile)
            
oplay.Play()
        
End If

        If 
operation "Pause" Then
            oplay 
= New Audio(ofile)
            
oplay.Pause()
        
End If

        If 
operation "Stop" Then
            oplay 
= New Audio(ofile)
            If 
oplay.Playing True Then
                oplay
.Stop()
            
End If

        
End If
    
End Sub