一:C# 播放音乐
引入命名空间:
using System.Media;
用法:
string sound = Application.StartupPath + "/sound/msg.wav"; //Application.StartupPath:程序exe所在的位置,也可以直接写一个音乐的路径 SoundPlayer player = new SoundPlayer(sound); player.Load(); //把声音加载到内存 //player.PlayLooping();//播放 player.Play();