c#windows窗体的背景音乐结束后一首继续播放下首背景音乐怎样实现(可以播放多首音乐)
展开全部
string[] s = new string[5];
int i = 0;
private void button5_Click(object sender, EventArgs e)
{
s[0] = @"H:\音乐\伴奏\First Snow.mp3";
s[1] = @"H:\音乐\伴奏\大漠荒颜.mp3";
s[2] = @"H:\音乐\伴奏\Good Knight.mp3";
s[3] = @"H:\音乐\伴奏\Maps.mp3";
s[4] = @"H:\音乐\伴奏\Wolf Drawn.mp3";
axWindowsMediaPlayer1.URL = s[i];
timer1.Interval = 500;
timer1.Start();
}
private void timer1_Tick(object sender, EventArgs e)
{
if (axWindowsMediaPlayer1.playState == WMPLib.WMPPlayState.wmppsStopped)
{
i++;
axWindowsMediaPlayer1.URL = s[i];
}
}
VS直接复制过来的.
感觉这法子不是很好,不知道大家有没有更好的方法.
int i = 0;
private void button5_Click(object sender, EventArgs e)
{
s[0] = @"H:\音乐\伴奏\First Snow.mp3";
s[1] = @"H:\音乐\伴奏\大漠荒颜.mp3";
s[2] = @"H:\音乐\伴奏\Good Knight.mp3";
s[3] = @"H:\音乐\伴奏\Maps.mp3";
s[4] = @"H:\音乐\伴奏\Wolf Drawn.mp3";
axWindowsMediaPlayer1.URL = s[i];
timer1.Interval = 500;
timer1.Start();
}
private void timer1_Tick(object sender, EventArgs e)
{
if (axWindowsMediaPlayer1.playState == WMPLib.WMPPlayState.wmppsStopped)
{
i++;
axWindowsMediaPlayer1.URL = s[i];
}
}
VS直接复制过来的.
感觉这法子不是很好,不知道大家有没有更好的方法.
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询