26-02-23, 11:34 PM
(18-02-23, 10:34 PM)سعود كتب : اكيد كلكم يعرف يمكننا صياغة كود يلبي المطلوب .هذا مثال لاحد الحلول الممكنة
PHP كود :
Public Class Form1
Dim list As New List(Of String)({"server8", "server7", "server10", "server12", "server13", "server11"})
Dim serveurnumber As String = ""
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim URL As String = "https://server13.mp3quran.net/basit_mjwd/002.mp3"
Dim URL1 As String = URL.Replace("server13", serveurnumber).Replace("basit_mjwd", "minsh")
Timer1.Start()
AxWindowsMediaPlayer1.URL = URL1
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
Static idx As Integer = 0
If idx < list.Count - 1 Then
idx += 1
serveurnumber = list(idx)
Else
idx = 0
End If
If Timer1.Enabled = True And AxWindowsMediaPlayer1.playState = WMPLib.WMPPlayState.wmppsReady Then
Button1.PerformClick()
ElseIf Timer1.Enabled = True And AxWindowsMediaPlayer1.playState = WMPLib.WMPPlayState.wmppsPlaying Then
Timer1.Stop()
End If
End Sub
End Class

