可以向 NTFS 文件夹添加自定义属性吗?
我希望能够将自己的自定义数据/属性添加到 NTFS 上的现有文件夹中,这样如果移动文件夹,属性也会随之移动。一种解决方案是在文件夹中存储一个文件来包含我需要或想要的任何内容。
我特别感兴趣的是是否有一种方法可以将自定义属性添加到目录文件系统对象本身。
I would like to be able to add my own custom data/properties to existing folders on NTFS, so that if a folder is moved, the properties move with it. One solution would be to store a file within the folder to contain whatever I need or want.
What I am particularly interested in, is whether or not there is a way to add custom properties to the directory file system object itself.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您感觉勇敢(
或愚蠢),也许有一个替代方案数据流将是一种替代方案。我不确定是否可以应用于目录而不是普通文件,并且它充满了需要考虑的问题:
快乐编码。
If you are feeling brave (
or foolish) perhaps an Alternative Data Stream would be an alternative.I am not sure if can be applied to a directory as opposed to a normal file and it's littered with concerns that need to be considered:
Happy coding.
这是 C# 中显示文件自定义属性的方法
首先在 file.CustomProperties.Add(key, ref value); 中
通过修改属性key(property),就可以修改它,这里有以下内容。
在 key 中,您应该放置以下 attribute_names 之一,这些属性名称在这里通过其实际值的名称描述为常量
然后您应该将所需的值分配给常量,在 value 中
然后查看每个文件的每个属性,它会在行上显示它们
Here is a way in c# to show file custom properties
First in file.CustomProperties.Add(key, ref value);
by modifying the attribute key(the property, you can modify it, here are the following.
in key you should put one of the following attribute_names, that are here described as constants by names from their real values
Then you should assign the desired value to the constant, in value
Then to see each properties of each file it show them on the line