C# 播放声音

播放系统声音:

string soundPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Windows) + Path.DirectorySeparatorChar + "Media" + Path.DirectorySeparatorChar + "Alarm01.wav";
if (System.IO.File.Exists(soundPath))
{
    AlertPlayer.SoundLocation = soundPath;
    AlertPlayer.Load();
    AlertPlayer.PlayLooping();
}

 

posted @ 2017-01-17 13:19  wzwyc  阅读(242)  评论(0编辑  收藏  举报