资源描述:
《C#开发音乐播放器》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、功能简介:1、循环模式:顺不播放axWMusicPlayer.settings.setMode("shuffle",false);全部循环axWMusicPlayer.settings.setMode("loop",true);随机播放axWMusicPlayer.settings.setMode("shuffle",true);2、模拟定时关机程序写到定时关机,具体的调用定时关机程序省略了,程序中相应地方有注解。定时关机代码1privatevoid关机时间toolStripTextBox_KeyPress(objectsender,KeyPressEve
2、ntArgse)2{3if(e.KeyChar==(char)Keys.Enter&&关机时间toolStripTextBox.Text!="")4{5try6{7DateTimetime=DateTime.Parse(关机时间toolStripTextBox.Text);8Timefontfont=newTimefont(time.Hour,time.Minute,0);9if(font.CompareTo(newTimefont(DateTime.Now.Hour,DateTime.Now.Minute,0))==0)//当前关机时间10{11if(M
3、essageBox.Show("你设定的关机时间是当前计算机时间,是否直接关机?","提示",MessageBoxButtons.YesNo,MessageBoxIcon.Information)==DialogResult.OK)12{13MynotifyIcon.Icon=Icon.ExtractAssociatedIcon(PathBase+"\Images\"+"ShutDown_notifyIcon.ico");14//15//调用关机程序16//17}18else19{20return;21}22}23if(font.CompareTo(n
4、ewTimefont(DateTime.Now.Hour,DateTime.Now.Minute,0))<0)//过去关机时间24{25MessageBox.Show("此时间已是过去时间,设定无效","提示",MessageBoxButtons.OK,MessageBoxIcon.Information);26return;27}28if(font.CompareTo(newTimefont(DateTime.Now.Hour,DateTime.Now.Minute,0))>0)//有效关机时间29{3031ShutDownTime=关机时间toolSt
5、ripTextBox.Text;32MessageBox.Show("成功设置定时关机,计算机将于“"+ShutDownTime+"”关机……*︶︵︶*","提示",MessageBoxButtons.OK,MessageBoxIcon.Information);33this.关机时间toolStripTextBox.Visible=false;34this.取消定时关机QToolStripMenuItem.Visible=true;3536//37//调用关机程序38//39}40}41catch42{43MessageBox.Show("日期格式不正确
6、,请重新输入。","提示",MessageBoxButtons.OK,MessageBoxIcon.Information);44return;45}46}47if(e.KeyChar==(char)Keys.Enter&&关机时间toolStripTextBox.Text=="")48{49关机时间toolStripTextBox.Visible=false;50}51}3、歌曲列表信息保存在XML文件中添加歌曲保存代码1privatevoidbtnList_Click(objectsender,EventArgse)//添加歌曲2{3openFileD
7、ialog1.Title="添加歌曲";4openFileDialog1.FileName="";5openFileDialog1.Multiselect=true;6openFileDialog1.Filter="Mp3文件
8、*.mp3
9、Wav文件
10、*.wav
11、Wma文件
12、*.wma
13、Wmv文件
14、*.wmv
15、所有格式
16、*.*";7openFileDialog1.InitialDirectory=Environment.GetFolderPath(Environment.SpecialFolder.MyMusic);8try9{10if(openFileD
17、ialog1.ShowDialog()==DialogResult