你可以用API 调用PlaySound来实现。
A Simple C# Class to Play .WAV Files in .NET
http://www.codeguru.com/cs_graphics/WavPlay.html
A Simple C# Class to Play .WAV Files in .NET
http://www.codeguru.com/cs_graphics/WavPlay.html
sysimport(dll="winmm.dll")]
public static extern long PlaySound(String lpszName, long hModule, longdwFlags);................PlaySound( szWavFileName , 0 , 0);
http://www.c-sharpcorner.com/Code/2002/July/MultimediaInNet.asp
不好意思,我刚学~你们发的那些我有点看不懂~
private void button8_Click(object sender, System.EventArgs e)
{
Button btn=(Button) sender;
if (gl)
{
textBox1.Text=btn.Text;
gl=false;
}
else if (textBox1.Text=="0")
{
textBox1.Text=btn.Text;
gl=false;
}
else
{
textBox1.Text=textBox1.Text+btn.Text;
gl=false;
}
shu = Convert.ToDouble(textBox1.Text);
{ [DllImport("winmm.dll", EntryPoint="PlaySound")]
public static extern bool PlaySound(ref Byte snd, IntPtr hmod, uint fdwSound);
[DllImport("winmm.dll", EntryPoint="PlaySound")]
public static extern int PlaySound(string lpszName,int hModule,int dwFlags); public enum PlayingFlags :uint
{
SND_SYNC = 0x00,
SND_ASYNC = 0x01,
SND_NODEFAULT = 0x02,
SND_MEMORY = 0x04,
SND_ALIAS = 0x010000,
SND_FILENAME = 0x020000,
SND_RESOURCE = 0x040004,
SND_ALIAS_ID = 0x0110000,
SND_ALIAS_START = 0,
SND_LOOP = 0x08,
SND_NOSTOP = 0x010,
SND_VALID = 0x01F,
SND_NOWAIT = 0x02000,
SND_PURGE = 0x40
}
类//调用
sndPlay.PlaySound(
filename, /*文件名自己改*/
0,
(int)sndPlay.PlayingFlags.SND_SYNC
);
?????????????????????????????????????