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
| Private Sub traitement_boucle(ByVal cas As String, ByVal boucle As Integer, ByVal jpg As String, ByVal basdef As String)
Dim Xwmp As IWMPMedia
Dim cmd As OleDbCommand = cnn.CreateCommand
For i = 1 To boucle
DirectCast(Me.Controls("AxWindowsMediaPlayer" & i), AxWindowsMediaPlayer).Refresh()
cmd.CommandText = String.Format("SELECT (Chm) from {0} WHERE [ID] =" & i, jpg)
cnn.Close()
cnn.Open()
Dim Lecture As OleDbDataReader = cmd.ExecuteReader
While Lecture.Read()
DirectCast(Me.Controls("AxWindowsMediaPlayer" & i), AxWindowsMediaPlayer).Visible = True
Xwmp = DirectCast(Me.Controls("AxWindowsMediaPlayer" & i), AxWindowsMediaPlayer).newMedia(Lecture(0))
DirectCast(Me.Controls("AxWindowsMediaPlayer" & i), AxWindowsMediaPlayer).currentPlaylist.insertItem(0, Xwmp)
DirectCast(Me.Controls("AxWindowsMediaPlayer" & i), AxWindowsMediaPlayer).Ctlcontrols.play()
DirectCast(Me.Controls("AxWindowsMediaPlayer" & i), AxWindowsMediaPlayer).Ctlcontrols.pause()
End While
cmd.CommandText = String.Format("SELECT (eti) from {0} WHERE [ID] =" & i, basdef)
cnn.Close()
cnn.Open()
Dim Lectureeti As OleDbDataReader = cmd.ExecuteReader
While Lectureetiquettes.Read()
DirectCast(Me.Controls("Label" & i), Label).Visible = True
DirectCast(Me.Controls("Label" & i), Label).Text = System.IO.Path.GetFileNameWithoutExtension(Lectureeti(0))
End While
Next
End Sub |
Partager