C#、VB.NET 使用System.Media.SoundPlayer播放音乐
本文章已收录于:
![](http://static.blog.csdn.net/images/category_icon.jpg)
同步播放:
System.Media.SoundPlayer player = new System.Media.SoundPlayer();
player.SoundLocation = @"d:/music/happy.wav";
player.Load();
player.Play();
异步播放:
System.Media.SoundPlayer player = new System.Media.SoundPlayer();
player.SoundLocation = @"d:/music/happy.wav";
player.LoadAsync();
player.PlaySync();
循环播放:
System.Media.SoundPlayer player = new System.Media.SoundPlayer();
player.SoundLocation = @"d:/music/happy.wav";
player.Load();
player.PlayLooping();