• 大小: 7.29MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-09-23
  • 语言: C#
  • 标签: C#修  件的属性  

资源简介

C#修改多媒体文件的属性

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.WindowsAPICodePack.Shell.PropertySystem;

namespace JiuYaoGuoRuanKaoMediaFilePropertiesEditor
{
    /// 
    /// 基本媒体文件属性编辑器
    /// 

    internal class baseMediaFilePropertiesEditor : ICommenMediaFilePropertiesEditor
    {
        /// 
        /// 文件名
        /// 

        protected string FileName { get; private set; }

        private IDictionary _args;

        /// 
        /// 
        /// 

        /// 
        /// 
        /// 
        public void EditMediaFileProperties(ShellProperties fileProperties IDictionary args string fileName)
        {
            this._args = args;
            this.FileName = fileName;
            EditMediaFileProperties(fileProperties);
        }

        protected string GetValueInArgs(string key)
        {
            if (!string.IsNullOrWhiteSpace(key) && this._args.ContainsKey(key))
                return this._args[key];
            return null;
        }

        protected virtual void EditMediaFileProperties(ShellProperties fileProperties)
        {
            if (fileProperties != null)
            {
                // 说明.标题
                string title = GetValueInArgs(DictionaryInfo.title);
                if (!string.IsNullOrWhiteSpace(title))
                {
                    if (fileProperties.System != null && fileProperties.System.title != null)
                    {
                        fileProperties.System.title.AllowSetTruncatedValue = true;
                        fileProperties.System.title.Value = title;
                    }
                }
                // 说明.副标题
                if (!string.IsNullOrWhiteSpace(title))
                {
                    if (fileProperties.System != null && fileProperties.System.Media != null && fileProperties.System.Media.Subtitle != null)
                    {
                        fileProperties.System.Media.Subtitle.AllowSetTruncatedValue = true;
                        fileProperties.System.Media.Subtitle.Value = title;
                    }
                }
                // 媒体.参与创作的艺术家
                string author = GetValueInArgs(DictionaryInfo.AUTHOR);
                if (!string.IsNullOrWhiteSpace(author))
                {
                    if (fileProperties.System != null && fileProperties.System.Author != null)
                    {
                        fileProperties.System.Author.AllowSetTruncatedValue = true;
                        fileProperties.System.Author.Value = new string[] { author };
                    }
                }
                // 媒体.流派
                string gener = GetValueInArgs(DictionaryInfo.MUSIC_GENRE);
 

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

     文件        187  2017-07-20 11:25  C#修改多媒体文件的属性\MediaFilePropertiesEditor\App.config

    I.A....     64794  2017-03-01 16:09  C#修改多媒体文件的属性\MediaFilePropertiesEditor\App.ico

     文件       4885  2017-03-02 10:12  C#修改多媒体文件的属性\MediaFilePropertiesEditor\baseMediaFilePropertiesEditor.cs

     文件         21  2017-03-02 10:28  C#修改多媒体文件的属性\MediaFilePropertiesEditor\bin\Debug\initOpenPath.setting

     文件     151552  2017-07-21 11:46  C#修改多媒体文件的属性\MediaFilePropertiesEditor\bin\Debug\JiuYaoGuoRuanKaoMediaFilePropertiesEditor.exe

     文件        187  2017-07-20 11:25  C#修改多媒体文件的属性\MediaFilePropertiesEditor\bin\Debug\JiuYaoGuoRuanKaoMediaFilePropertiesEditor.exe.config

     文件      38400  2017-07-21 11:46  C#修改多媒体文件的属性\MediaFilePropertiesEditor\bin\Debug\JiuYaoGuoRuanKaoMediaFilePropertiesEditor.pdb

     文件      24224  2017-07-21 11:46  C#修改多媒体文件的属性\MediaFilePropertiesEditor\bin\Debug\JiuYaoGuoRuanKaoMediaFilePropertiesEditor.vshost.exe

     文件        187  2017-07-20 11:25  C#修改多媒体文件的属性\MediaFilePropertiesEditor\bin\Debug\JiuYaoGuoRuanKaoMediaFilePropertiesEditor.vshost.exe.config

     文件        490  2015-10-22 09:54  C#修改多媒体文件的属性\MediaFilePropertiesEditor\bin\Debug\JiuYaoGuoRuanKaoMediaFilePropertiesEditor.vshost.exe.manifest

     文件     105984  2010-08-02 21:05  C#修改多媒体文件的属性\MediaFilePropertiesEditor\bin\Debug\Microsoft.WindowsAPICodePack.dll

     文件     542720  2010-08-02 21:05  C#修改多媒体文件的属性\MediaFilePropertiesEditor\bin\Debug\Microsoft.WindowsAPICodePack.Shell.dll

     文件    1246510  2017-07-01 14:01  C#修改多媒体文件的属性\MediaFilePropertiesEditor\bin\Debug\源码必读.pdf

     文件     151040  2017-07-21 13:41  C#修改多媒体文件的属性\MediaFilePropertiesEditor\bin\Release\91grk媒体文件属性编辑器.exe

     文件        187  2017-07-20 11:25  C#修改多媒体文件的属性\MediaFilePropertiesEditor\bin\Release\91grk媒体文件属性编辑器.exe.config

     文件      36352  2017-07-21 13:41  C#修改多媒体文件的属性\MediaFilePropertiesEditor\bin\Release\91grk媒体文件属性编辑器.pdb

     文件      24224  2017-07-21 13:41  C#修改多媒体文件的属性\MediaFilePropertiesEditor\bin\Release\91grk媒体文件属性编辑器.vshost.exe

     文件        187  2017-07-20 11:25  C#修改多媒体文件的属性\MediaFilePropertiesEditor\bin\Release\91grk媒体文件属性编辑器.vshost.exe.config

     文件      36352  2017-07-21 11:47  C#修改多媒体文件的属性\MediaFilePropertiesEditor\bin\Release\JiuYaoGuoRuanKaoMediaFilePropertiesEditor.pdb

     文件        187  2017-07-20 11:25  C#修改多媒体文件的属性\MediaFilePropertiesEditor\bin\Release\JiuYaoGuoRuanKaoMediaFilePropertiesEditor.vshost.exe.config

     文件        490  2015-10-22 09:54  C#修改多媒体文件的属性\MediaFilePropertiesEditor\bin\Release\JiuYaoGuoRuanKaoMediaFilePropertiesEditor.vshost.exe.manifest

     文件     105984  2010-08-02 21:05  C#修改多媒体文件的属性\MediaFilePropertiesEditor\bin\Release\Microsoft.WindowsAPICodePack.dll

     文件     542720  2010-08-02 21:05  C#修改多媒体文件的属性\MediaFilePropertiesEditor\bin\Release\Microsoft.WindowsAPICodePack.Shell.dll

     文件    1246510  2017-07-01 14:01  C#修改多媒体文件的属性\MediaFilePropertiesEditor\bin\Release\源码必读.pdf

     文件    1246510  2017-07-01 14:01  C#修改多媒体文件的属性\MediaFilePropertiesEditor\bin\源码必读.pdf

     文件       3764  2017-03-01 17:21  C#修改多媒体文件的属性\MediaFilePropertiesEditor\DictionaryInfo.cs

     文件       6076  2017-07-21 13:40  C#修改多媒体文件的属性\MediaFilePropertiesEditor\FrmMain.cs

     文件       9898  2017-07-21 13:40  C#修改多媒体文件的属性\MediaFilePropertiesEditor\FrmMain.Designer.cs

     文件     106301  2017-07-21 13:40  C#修改多媒体文件的属性\MediaFilePropertiesEditor\FrmMain.resx

     文件        721  2017-07-20 14:41  C#修改多媒体文件的属性\MediaFilePropertiesEditor\ICommenMediaFilePropertiesEditor.cs

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

评论

共有 条评论