资源简介


资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Runtime.Serialization.Formatters.Binary;
using System.Text;
using System.Threading.Tasks;
using System.xml;
using System.xml.Linq;

namespace Flyer.MusicPlayer
{
    [Serializable]
    public class Engine
    {
        public static string songPath = string.Empty; //歌曲路径
        public static string skinPath = string.Empty; //皮肤路径
        public static string lrcPath = string.Empty; //歌词路径
        public static Dictionary dicLrc = new Dictionary();//存放歌词

        public static bool Playing = true;//自动播放
        public static bool SaveList = true;//保存列表
        public static bool Min = true;//最小化
        public static bool Exit = false;//退出

        #region 读取/保存xml
        /// 
        /// 读取路径
        /// 

        public static void Readxml()
        {
            xmlDocument xml = new xmlDocument();
            xml.Load(“xml\\Data.xml“);
            xmlNode parent = xml.DocumentElement;
            songPath = parent[“Song“].InnerText;
            skinPath = parent[“Skin“].InnerText;
            Playing = Convert.ToBoolean(parent[“Playing“].InnerText);
            SaveList = Convert.ToBoolean(parent[“SaveList“].InnerText);
            Min = Convert.ToBoolean(parent[“Min“].InnerText);
            Exit = Convert.ToBoolean(parent[“Exit“].InnerText);
        }
        public static void Wirtexml()
        {
            XDocument doc = new XDocument(//创建xml文档对象
                new XDeclaration(“1.0“ “utf-8“ “yes“)//添加xml文件声明
                new XElement(“Path“//创建xml元素
                        new XElement(“Song“ songPath)
                        new XElement(“Skin“ skinPath)
                         new XElement(“Playing“ Playing)
                          new XElement(“SaveList“ SaveList)
                           new XElement(“Min“ Min)
                            new XElement(“Exit“ Exit)
                    )
                );
            doc.Save(“xml\\Data.xml“);//保存xml文档
        }
        #endregion

        /// 
        /// 读取文件夹歌曲
        /// 

        public static void ReadSong()
        {
            PlayList.song.Clear();
            if (!Directory.Exists(songPath))
            {
                songPath = string.Empty;
                return;
            }
            //创建一个对象,可以枚举该路径下的所有文件,形成筛选
            DirectoryInfo dir = new DirectoryInfo(songPath);
            //设置筛选条件:媒体文件|*.mp3;*.wav;*.wma;*.avi;*.mpg;*.asf;*.wmv
            FileInfo[] files = dir.GetFiles(“*.mp3“);
            files.Concat(dir.GetFiles(“*.mp4“));
            files.Concat(dir.GetFiles(“*.wma“));
            for (int i = 0; i < files.Length; i++)
            {
                //遍历所有文件把筛选到的加入所有歌曲集合
                Song song = new Song();
                song.Id = i + 1;
                

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

    ..A..H.     63488  2021-01-14 00:03  Flyer.MusicPlayer\.vs\Flyer.MusicPlayer\v15\.suo

     文件          0  2021-01-13 17:35  Flyer.MusicPlayer\.vs\Flyer.MusicPlayer\v15\Server\sqlite3\db.lock

     文件       4096  2021-01-13 17:35  Flyer.MusicPlayer\.vs\Flyer.MusicPlayer\v15\Server\sqlite3\storage.ide

     文件      32768  2021-01-13 17:35  Flyer.MusicPlayer\.vs\Flyer.MusicPlayer\v15\Server\sqlite3\storage.ide-shm

     文件     815792  2021-01-13 18:52  Flyer.MusicPlayer\.vs\Flyer.MusicPlayer\v15\Server\sqlite3\storage.ide-wal

     文件        187  2020-03-11 22:09  Flyer.MusicPlayer\Flyer.MusicPlayer\App.config

     文件      53760  2020-03-11 22:08  Flyer.MusicPlayer\Flyer.MusicPlayer\bin\Debug\AxInterop.WMPLib.dll

     文件     305664  2020-04-22 13:43  Flyer.MusicPlayer\Flyer.MusicPlayer\bin\Debug\Flyer.MusicPlayer.exe

     文件        187  2020-03-11 22:09  Flyer.MusicPlayer\Flyer.MusicPlayer\bin\Debug\Flyer.MusicPlayer.exe.config

     文件       2152  2020-03-11 22:08  Flyer.MusicPlayer\Flyer.MusicPlayer\bin\Debug\Flyer.MusicPlayer.exe.lnk

     文件      91648  2020-04-22 13:43  Flyer.MusicPlayer\Flyer.MusicPlayer\bin\Debug\Flyer.MusicPlayer.pdb

     文件      22984  2020-04-22 13:46  Flyer.MusicPlayer\Flyer.MusicPlayer\bin\Debug\Flyer.MusicPlayer.vshost.exe

     文件        187  2020-03-11 22:09  Flyer.MusicPlayer\Flyer.MusicPlayer\bin\Debug\Flyer.MusicPlayer.vshost.exe.config

     文件        490  2017-04-11 11:11  Flyer.MusicPlayer\Flyer.MusicPlayer\bin\Debug\Flyer.MusicPlayer.vshost.exe.manifest

     文件        905  2020-03-11 22:08  Flyer.MusicPlayer\Flyer.MusicPlayer\bin\Debug\Images\album.png

     文件      11796  2020-03-11 22:08  Flyer.MusicPlayer\Flyer.MusicPlayer\bin\Debug\Images\DefaultAlbum.png

     文件      16586  2020-03-11 22:08  Flyer.MusicPlayer\Flyer.MusicPlayer\bin\Debug\Images\defaultSmallAblum.png

     文件        551  2020-03-11 22:08  Flyer.MusicPlayer\Flyer.MusicPlayer\bin\Debug\Images\favorite.png

     文件        649  2020-03-11 22:08  Flyer.MusicPlayer\Flyer.MusicPlayer\bin\Debug\Images\list.png

     文件        691  2020-03-11 22:08  Flyer.MusicPlayer\Flyer.MusicPlayer\bin\Debug\Images\message.png

     文件        609  2020-03-11 22:08  Flyer.MusicPlayer\Flyer.MusicPlayer\bin\Debug\Images\musicLibrary.png

     文件      67646  2020-03-11 22:08  Flyer.MusicPlayer\Flyer.MusicPlayer\bin\Debug\Images\notifyIcon128x128.ico

     文件        293  2020-03-11 22:08  Flyer.MusicPlayer\Flyer.MusicPlayer\bin\Debug\Images\ranking.png

     文件        509  2020-03-11 22:08  Flyer.MusicPlayer\Flyer.MusicPlayer\bin\Debug\Images\star.png

     文件        663  2020-03-11 22:08  Flyer.MusicPlayer\Flyer.MusicPlayer\bin\Debug\Images\user.png

     文件     188975  2020-03-11 22:08  Flyer.MusicPlayer\Flyer.MusicPlayer\bin\Debug\Images\wallhaven-12422.jpg

     文件       4286  2020-03-11 22:08  Flyer.MusicPlayer\Flyer.MusicPlayer\bin\Debug\Images\上一首.ico

     文件       1204  2020-03-11 22:08  Flyer.MusicPlayer\Flyer.MusicPlayer\bin\Debug\Images\上一首.png

     文件       1389  2020-03-11 22:08  Flyer.MusicPlayer\Flyer.MusicPlayer\bin\Debug\Images\上一首hoover.png

     文件       4286  2020-03-11 22:08  Flyer.MusicPlayer\Flyer.MusicPlayer\bin\Debug\Images\下一首.ico

............此处省略135个文件信息

评论

共有 条评论