2014-03-13 162 views
3

我已經看到使用GetDetailsOf()獲得有關貝殼項目的細節的答案,但數字總是幻數。有什麼選項可用於Shell32.Folder.GetDetailsOf(..,..)?

我已經看過FolderItemGetDetailsOf的文檔,但什麼也沒找到。 (後者中的列表不適用於所有內容,不包括「說明」,「作者」,也不包含回收站刪除日期...項目?它是否列在某處?

+0

這些不是.NET方法,它們是COM腳本方法 –

+0

不確定這將有助於http://archive.msdn.microsoft.com/WindowsAPICodePack你已經看到了這個? http://stackoverflow.com/questions/220097/read-write-extended-file-properties-c – Paparazzi

+1

它們是列號,當你用資源管理器查看文件夾並將視圖切換到詳細信息時,您會看到這些列號。它只與真實文件系統文件夾一致,像RecycleBin這樣的虛擬文件夾有其自己的列。 –

回答

6

我明白了這個意外。如果您將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:上的文件可以使用哪些屬性,具體取決於其格式。

相關問題