Hi! Is there any good way of playing a sound when clicking a button on my web page?? It works great on my local mashine but won't work on the server! I don't want any windows media player or any other window to pop up! Just to play a wav sound!
This is the code that works on my local mashine!
Private Declare Auto Function PlaySound Lib "winmm.dll" (ByVal lpszSoundName As String, ByVal hModule As Integer, ByVal dwFlags As Integer) As Integer
Private Const SND_FILENAME As Integer = &H20000
Public Function PlayWav(ByVal fileFullPath As String) As Boolean
Dim iRet As Integer = 0
Try
iRet = PlaySound(fileFullPath, 0, SND_FILENAME)
Catch
End Try
Return iRet
End Function
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
PlayWav("C:\pling.wav")
End Sub
...
Go to the complete details ...