我见过使用GetDetailsOf()
获取shell项详细信息的答案,但这些数字总是神奇的数字。
我查看了FolderItem和GetDetailsOf的文档,但什么也没有发现。(后者中的列表并不适用于所有情况。它们不包括“描述”、“作者”,也不包括回收站删除日期…)
有什么方法可以返回一个项目的可能选项吗?它列在什么地方了吗?
最佳答案
我是偶然发现的。如果您将null
传递到GetDetailsOf
中,则它将使用列名进行响应。例如,使用cscript
执行以下jscript:
var shellapp = WScript.CreateObject("Shell.Application");
var folder = shellapp.NameSpace("D:\\");
for (var j = 0; j < 0xFFFF; j++) {
detail = folder.GetDetailsOf(null, j);
if (!detail) {
break;
}
WScript.Echo("[" + j + "] = " + detail);
}
在我的Windows 10系统上,此输出:
[0] = Name
[1] = Size
[2] = Item type
[3] = Date modified
[4] = Date created
[5] = Date accessed
[6] = Attributes
[7] = Offline status
[8] = Availability
[9] = Perceived type
[10] = Owner
[11] = Kind
[12] = Date taken
[13] = Contributing artists
[14] = Album
[15] = Year
[16] = Genre
[17] = Conductors
[18] = Tags
[19] = Rating
[20] = Authors
[21] = Title
[22] = Subject
[23] = Categories
[24] = Comments
[25] = Copyright
[26] = #
[27] = Length
[28] = Bit rate
[29] = Protected
[30] = Camera model
[31] = Dimensions
[32] = Camera maker
[33] = Company
[34] = File description
[35] = Program name
[36] = Duration
[37] = Is online
[38] = Is recurring
[39] = Location
[40] = Optional attendee addresses
[41] = Optional attendees
[42] = Organizer address
[43] = Organizer name
[44] = Reminder time
[45] = Required attendee addresses
[46] = Required attendees
[47] = Resources
[48] = Meeting status
[49] = Free/busy status
[50] = Total size
[51] = Account name
这与windows 2000有很大的不同,正如Retrieving Extended File Properties中详细描述的那样。顺便说一下,如果传入不同的
NameSpace
,则将获得不同的属性。在我的示例中,我询问驱动器D:
上的文件有哪些属性,这些属性可能因其格式而异。