Tuesday, April 2, 2013

C# (Play Sound On Button Click)


using System.Media;

protected void Button1_Click(object senderEventArgs e) 
{    

         SoundPlayer sd = new SoundPlayer();
         sd.SoundLocation = Server.MapPath("~/sounds/File.wav");
         sd.Play();
}

4 comments:

  1. Thanks for the code

    ReplyDelete
  2. This comment has been removed by a blog administrator.

    ReplyDelete
  3. It is not playing on server side. play only in client or we can say that only on local machine

    ReplyDelete
  4. Your work is truly appreciated round the clock and the globe. It is incredibly a comprehensive and helpful blog. subliminal messages

    ReplyDelete