使用ShellClass获取文件属性详细信息的实现方法
2013-05-15 14:48
946 查看
首先引用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
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
您可能感兴趣的文章:
- shell对比文件内容脚本分享
- 批量转换目录下文件编码的shell脚本代码
- linux下保留文件系统下剩余指定数目文件的shell脚本
- shell去掉文件中空行(空白行)的方法详解
- shell判断文件,目录是否存在或者具有权限的代码
- 判断文件是否存在的shell脚本代码
- 合并一个文件夹下多个文件内容的单行shell命令
- 查找目录下同名但不同后缀名文件的shell脚本代码
- 在指定目录查找指定后缀文件的shell脚本代码
- shell查找当前目录下大于1M的文件的三种方法分享
- 后台实时分流文件的shell脚本
- 找出文件中包含指定字段的文件的shell脚本
- Visual Style中的shellstyle.dll文件修改方法
- Byshell后门:无进程无DLL无硬盘文件
- shell替换文件中的文件路径脚本分享
相关文章推荐
- 使用ShellClass获取文件属性详细信息
- 使用ShellClass获取文件属性详细信息
- class_copyPropertyList与class_copyIvarList区别,获取属性,使用runtime方法的注意事项
- 本文使用c#通过oledb可获取excel文件表的结构信息,同理也可以获得access等数据库的表结构信息,实现如下:
- 利用反射获取.DLL文件中的属性和方法以及版本信息
- 使用CreateToolhelp32Snapshot获取指定进程详细信息的方法
- 如何使用adb查看各个文件属性详细信息
- php使用ffmpeg获取视频信息并截图的实现方法
- 使用Windows API实现运行时动态获取程序文件版本信息
- javascript通过获取html标签属性class实现多选项卡的方法
- 在Autodesk Vault 2014中使用VDF(Vault Development Framework) API获取所有文件的属性信息
- java 扫描Class文件获取接口对应的实现类及其方法util
- 获取文件详细信息的方法
- 如何使用libcurl实现HTTP的GET方法获取文件长度
- 使用getCurrentPosition方法实时获取当前Geolocation信息(附源码文件)--html5、JavaScript
- 如何在windows下和linux下获取文件(如exe文件)的详细信息和属性
- php使用ffmpeg获取视频信息并截图的实现方法
- iOS - 自主实现类似微信语音视频信息聊天 (idoubs详细使用方法)1.0
- C++语言 获取EXE文件的属性详细信息