播放器自动播放问题
因为我的播放器刚刚开始写不久,目前只要选中了listview(播放列表)里的歌曲后,就会把歌曲的路径赋值给media player的url后,media player就自动播放了,在属性里面找了半天没找到能关闭自动播放的属性,如果在路径赋值给URL后,加个stop()语句么,速度又慢了,大虾们有什么高招么?
程序代码:
private string[] playList = new string[10000]; private void btnPlayer_Click(object sender, EventArgs e) { int SelectOne; if (listBox1.SelectedIndex < 0) SelectOne = 1; else SelectOne = listBox1.SelectedIndex + 1; if (listBox1.Items.Count < 0) listBox1.SelectedIndex = 0; PlaySong(SelectOne); } public void PlaySong(int selectNum) { WindowsMediaPlayer1.URL = playList[selectNum]; }