I use these following codes to play music while clicking the button.
private void button1_Click(object sender, EventArgs e)
{
SoundPlayer s = new SoundPlayer();
s.SoundLocation = @"f:\1.wav";
s.Play();
}
But these codes are only for my computer what should i do so that i can play this sound on the other computers like database. what should i do so that i can play this song in other computers?
Thanks in advance
You can import the file in the project’s resources and load it from there using
In order to import something to the resources do the following (assuming you use Visual Studio 2010 – it is similar to other versions I think):
Note that when you will install your application later on other computers the resources will be installed as well.
In order to play the sound you need to do the following then: