play wave sound in C#

G

Guest

Dear All

How can i play wave file automatic when the user rum my program using c#.

--
Regards
Mohamed Afifi
Web Developer
Bridgemont Holding Company
www.alqanat.com
 
F

Fred Mellender

public static void PlaySound()

{

String fileName = @"C:/Windows/Media/tada.wav";

PlaySound(fileName,0,1);

}

[DllImport("winmm.dll")]

private static extern bool PlaySound(string lpszName,

int hModule, int dwFlags);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top