C#、VB.NET 使用System.Media.SoundPlayer播放音乐
2009-05-21 11:10 2189人阅读 评论(1) 收藏 举报
本文章已收录于:
.embody { padding: 10px 10px 10px; margin: 0 -20px; border-bottom: solid 1px #ededed }
.embody_b { margin: 0; padding: 10px 0 }
.embody .embody_t,.embody .embody_c { display: inline-block; margin-right: 10px }
.embody_t { font-size: 12px; color: #999 }
.embody_c { font-size: 12px }
.embody_c img,.embody_c em { display: inline-block; vertical-align: middle }
.embody_c img { width: 30px; height: 30px }
.embody_c em { margin: 0 20px 0 10px; color: #333; font-style: normal }
分类:
C#(370)
同步播放:
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();
时间: 2024-10-11 03:02:08