Пример #1
0
 /// <summary>
 /// Save ID3v1 information to file
 /// </summary>
 public void Save()
 {
     FileStreamEx fs = new FileStreamEx(_FilePath, FileMode.Open);
     bool HTag = fs.HaveID3v1();
     if (HTag && !_HaveTag) // just delete ID3
         fs.SetLength(fs.Length - 128);
     else if (!HTag && _HaveTag)
     {
         fs.Seek(0, SeekOrigin.End);
         fs.Write(GetTagBytes, 0, 128);
     }
     else if (HTag && _HaveTag)
     {
         fs.Seek(-128, SeekOrigin.End);
         fs.Write(GetTagBytes, 0, 128);
     }
     fs.Close();
 }