时间:2021-05-19
首先引用COM组件
Microsoft Shell Controls And Automation
这里需要注意
DLL的属性Embed Interop Type 设为False
否则会引起互操作类型异常
代码如下
ShellClass sh = new ShellClass();
Folder dir = sh.NameSpace(Path.GetDirectoryName(sFile));
FolderItem item = dir.ParseName(Path.GetFileName(sFile));
string det = dir.GetDetailsOf(item, iCol);
iCol 对应文件详细属性汇总
ID => DETAIL-NAME
0 => Name
1 => Size
2 => Type
3 => Date modified
4 => Date created
5 => Date accessed
6 => Attributes
7 => Offline status
8 => Offline availability
9 => Perceived type
10 => Owner
11 => Kinds
12 => Date taken
13 => 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 => Free/busy status
49 => Total size
50 => Account name
51 => Computer
52 => Anniversary
53 => Assistant's name
54 => Assistant's phone
55 => Birthday
56 => Business address
57 => Business city
58 => Business country/region
59 => Business P.O. box
60 => Business postal code
61 => Business state or province
62 => Business street
63 => Business fax
64 => Business home page
65 => Business phone
66 => Callback number
67 => Car phone
68 => Children
69 => Company main phone
70 => Department
71 => E-mail Address
72 => E-mail2
73 => E-mail3
74 => E-mail list
75 => E-mail display name
76 => File as
77 => First name
78 => Full name
79 => Gender
80 => Given name
81 => Hobbies
82 => Home address
83 => Home city
84 => Home country/region
85 => Home P.O. box
86 => Home postal code
声明:本页内容来源网络,仅供用户参考;我单位不保证亦不表示资料全面及准确无误,也不保证亦不表示这些资料为最新信息,如因任何原因,本网内容或者用户因倚赖本网内容造成任何损失或损害,我单位将不会负任何法律责任。如涉及版权问题,请提交至online#300.cn邮箱联系删除。
PHPReflection是用于获取类、扩展、方法、函数、对象、参数、属性的详细信息。ReflectionClass类获取类相关信息,如获取属性、方法、文档注释
本文实例讲述了C#使用shell32获取文件属性的方法。分享给大家供大家参考。具体实现方法如下:usingSystem;usingSystem.Collecti
查看文件属性有多种方法,且这些方法中偏向不同,具体如下:1,lsls-a查看所有文件ls-l查看详细的属性2,lsattr查看文件的扩展属性,如果文件被 cha
用户可设置的文件属性有隐藏、存档、只读。 文件属性是指将文件分为不同类型的文件,以便存放和传输,定义了文件的某种独特性质。常见的文件属性有系统属性、隐藏属性、
反射是在PHP运行状态中,扩展分析PHP程序,导出或提取出关于类、方法、属性、参数等的详细信息,包括注释。这种动态获取的信息以及动态调用对象的方法的功能称为反射