19-10-24, 06:36 AM
(18-10-24, 02:41 AM)Zuhare كتب : [تحديث] هذا الكود باستخدام mci
PHP كود :
Public Class Form1
Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Integer, ByVal hwndCallback As Integer) As Integer
Private Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
Dim filename = "audio.mp3"
mciSendString("close 0", Nothing, 0, 0)
mciSendString(String.Format("open ""{0}"" alias 0", filename), Nothing, 0, 0)
mciSendString("play 0", Nothing, 0, 0)
End Sub
End Class
طريقة ثانية لكود الأخ(Zuhare) ... :
يا عزيزي جرب أنّ تعدل الكود أعلاه ليصبح :
PHP كود :
Public Class Form1
Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Integer, ByVal hwndCallback As Integer) As Integer
Private Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
Dim filename = "audio.mp3"
mciSendString("close 0", Nothing, 0, 0)
My.Computer.Audio.Stop()
mciSendString(String.Format("open ""{0}"" alias 0", filename), Nothing, 0, 0)
mciSendString("play 0", Nothing, 0, 0)
End Sub
End Class
قال صلى الله عليه وسلم:
«كلمتان خفيفتان على اللسان
ثقيلتان في الميزان،حبيبتان إلى الرحمن:
سبحان الله وبحمده، سبحان الله العظيم».
