示例#1
0
        public static string rootPath = System.Environment.CurrentDirectory; //程序根目录路径

        #endregion Fields

        #region Methods

        public static string GetMP3Name(SongJson songJson)
        {
            string title = songJson.title;
            string artist = songJson.artist;
            foreach (char c in invalidChars)
            {
                title = title.Replace(c, ' ');
                artist = artist.Replace(c, ' ');
            }

            return title + " - " + artist + ".mp3";
        }
示例#2
0
 public static string GetPicturePath(SongJson songJson, string channel_name)
 {
     string path = GetMP3Path(songJson, channel_name);
     return Path.ChangeExtension(path, "jpg");
 }
示例#3
0
 public static string GetMP3Path(SongJson songJson, string channel_name)
 {
     string songName = Helper.GetMP3Name(songJson);
     string folderPath = Path.Combine(Path.Combine(rootPath, libraryFolderName), channel_name.ToString());
     return Path.Combine(folderPath, songName);
 }