我试图找出如何读取/写入C#中的扩展文件属性,例如,您可以在Windows资源管理器中看到的注释,比特率,访问日期,类别等.任何想法如何做到这一点?编辑:我主要是读/写视频文件(AVI/DIVX/...)
我需要使用C#从"Media Created"列中提取日期(在下面的示例照片中以绿色突出显示).
在我的示例中,"Media Created"和"Date"列完全相同.但是,有几种情况并非如此."媒体创建"列包含实际录制视频的正确日期.

这是我用来获得它的功能.感谢Aziz指出我正确的方向:
Shell shell = new ShellClass();
Folder folder = shell.NameSpace(_File.DirectoryName);
FolderItem file = folder.ParseName(_File.Name);
// These are the characters that are not allowing me to parse into a DateTime
char[] charactersToRemove = new char[] {
(char)8206,
(char)8207
};
// Getting the "Media Created" label (don't really need this, but what the heck)
string name = folder.GetDetailsOf(null, 191);
// Getting the "Media Created" value as a string
string value = folder.GetDetailsOf(file, 191).Trim();
// Removing the suspect characters …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 PowerShell 检索“详细信息”选项卡的“媒体”部分中列出的一些扩展文件属性(准确地说是 mp3 文件)。
有喜欢的附加属性bitrate,genre,album,等。
可悲的Get-ItemProperty -Path $pathtofile | Format-List是不会返回那些。
Get-ItemProperty -Path $pathtofile | Get-Member 也没有列出它们。
很奇怪,Get-ItemProperty返回与Get-ChildItem.
我尝试了不同的文件(甚至非 mp3),而 PowerShell 没有在任何地方列出“详细信息”属性。
Windows 在哪里存储这些?又怎么能一一列举呢?
我尝试使用Get-ChildItem和Trash获取文件夹的已删除文件,但效果不佳。在垃圾桶中,我可以获取文件,但是我不知道如何发现执行脚本的文件夹中的文件。
Get-ChildItem -Recurse -File #Can`t get deleted files
#I get the deleted files, but I dont know what folder they come
$Shell = New-Object -ComObject "Shell.Application"
($Shell.NameSpace(0xa)).items()
Run Code Online (Sandbox Code Playgroud)