Read/Write 'Extended' file properties (C#)

后端 未结 10 2203
我在风中等你
我在风中等你 2020-11-22 02:54

I\'m trying to find out how to read/write to the extended file properties in C# e.g. Comment, Bit Rate, Date Accessed, Category etc that you can see in Windows explorer. An

10条回答
  •  伪装坚强ぢ
    2020-11-22 03:32

    GetDetailsOf() Method - Retrieves details about an item in a folder. For example, its size, type, or the time of its last modification. File Properties may vary based on the Windows-OS version.

    List arrHeaders = new List();
    
     Shell shell = new ShellClass();
     Folder rFolder = shell.NameSpace(_rootPath);
     FolderItem rFiles = rFolder.ParseName(filename);
    
     for (int i = 0; i < short.MaxValue; i++)
     {
          string value = rFolder.GetDetailsOf(rFiles, i).Trim();
          arrHeaders.Add(value);
     }
    

提交回复
热议问题