首先引用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
使用ShellClass获取文件属性详细信息的实现方法
2020-11-30 15:36编程技术网 C/C++
本篇文章是对ShellClass获取文件属性详细信息的实现方法进行了详细的分析介绍,需要的朋友参考下
延伸 · 阅读
- 2022-01-04linux 查看文件的属性(ls,lsattr,file,stat)实例
- 2021-11-23PHP获取文件属性的最简单方法
- 2020-08-27rhs和rhsa文件属性的文件删除方法
- 2019-11-18linux系统的文件属性详解
- 2019-10-16JAVA读取属性文件的几种方法总结
- 2019-09-08隐藏修改文件时间和文件属性的ASP脚本
- C/C++
浅谈防不胜防的unsigned int的运算
下面小编就为大家带来一篇浅谈防不胜防的unsigned int的运算。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧...
- C/C++
C++输入一个字符串,把其中的字符按照逆序输出的两种方法解析
以下是对C++中输入一个字符串,把其中的字符按照逆序输出的两种方法进行了详细的分析介绍,需要的朋友可以过来参考下...
- C/C++
构造函数不能声明为虚函数的原因及分析
构造函数不需要是虚函数,也不允许是虚函数,因为创建一个对象时我们总是要明确指定对象的类型,尽管我们可能通过实验室的基类的指针或引用去访问...
- C/C++
Opencv绘制最小外接矩形、最小外接圆
这篇文章主要为大家详细介绍了Opencv绘制最小外接矩形、最小外接圆的方法,文中示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以...
- C/C++
深入分析C++中deque的使用
本篇文章介绍了,深入分析C++中deque的使用。需要的朋友参考下...
- C/C++
C语言实现随机抽奖程序
这篇文章主要为大家详细介绍了C语言实现随机抽奖程序,文中示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下...
- C/C++
Visual Studio C++指针靠前靠后的问题全面解析
这篇文章主要介绍了Visual Studio C++指针靠前靠后的问题全面解析,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可...
- C/C++
如何用C语言、Python实现栈及典型应用
本文先通过实例分别介绍了如何用C语言、Python实现栈,后又介绍栈的典型应用,对大家学习栈很有借鉴参考价值,下面一起来看看吧。...