C#获取文件详细备注信息
2008-09-03 13:07
302 查看
项目中引用 Shell32.dll;
using System.IO;
using Shell32;
ShellClass sh = new ShellClass();
Folder dir = sh.NameSpace(Path.GetDirectoryName(strPath));
FolderItem item = dir.ParseName(Path.GetFileName(strPath));
StringBuilder sb = new StringBuilder();
for (int i = -1; i < 50; i++)
{
// 0 Retrieves the name of the item.
// 1 Retrieves the size of the item.
// 2 Retrieves the type of the item.
// 3 Retrieves the date and time that the item was last modified.
// 4 Retrieves the attributes of the item.
// -1 Retrieves the info tip information for the item.
sb.Append(i.ToString());
sb.Append(":");
sb.Append(dir.GetDetailsOf(item, i));
sb.Append("/r/n");
}
string c = sb.ToString();
结果:
-1:艺术家: 谭晶
唱片标题: 北京2008奥运会歌曲专辑
发行年: 2008
曲目号码: 20
持续时间: 0:04:21
类型: MP3 格式声音
比特率: 128kbps
受保护: 否
大小: 3.98 MB -----全部
0:一起飞(谭晶 阎维文).mp3 ------文件名
1:4,083 KB ------文件大小
2:MP3 格式声音 -----文件类型
3:2008-9-3 12:58 -----修改时间
4:2008-8-26 11:44 ------创建时间
5:2008-9-3 12:58 ------访问时间
6:A
7:在线
8:Administrators
9:谭晶 -------作者
10:一起飞 -------标题
11:
12:Pop -----------流派
13:
14:思恒网—新闻工作者的摇篮!ww -------备注
15:
16:谭晶 -----艺术家
17:北京2008奥运会歌曲专辑 -----唱片标题
18:2008 -----发行年
19:20 ------曲目号码
20:Pop -----流派
21:0:04:21 ------持续时间
22:128kbps ------比特率
23:否 -----受保护
24:
25:
26:
27:
28:
29:
30:
31:
32:0 位
33:44 kHz ------音频采样级别
34:2 (立体声) -------频道
35:
using System.IO;
using Shell32;
ShellClass sh = new ShellClass();
Folder dir = sh.NameSpace(Path.GetDirectoryName(strPath));
FolderItem item = dir.ParseName(Path.GetFileName(strPath));
StringBuilder sb = new StringBuilder();
for (int i = -1; i < 50; i++)
{
// 0 Retrieves the name of the item.
// 1 Retrieves the size of the item.
// 2 Retrieves the type of the item.
// 3 Retrieves the date and time that the item was last modified.
// 4 Retrieves the attributes of the item.
// -1 Retrieves the info tip information for the item.
sb.Append(i.ToString());
sb.Append(":");
sb.Append(dir.GetDetailsOf(item, i));
sb.Append("/r/n");
}
string c = sb.ToString();
结果:
-1:艺术家: 谭晶
唱片标题: 北京2008奥运会歌曲专辑
发行年: 2008
曲目号码: 20
持续时间: 0:04:21
类型: MP3 格式声音
比特率: 128kbps
受保护: 否
大小: 3.98 MB -----全部
0:一起飞(谭晶 阎维文).mp3 ------文件名
1:4,083 KB ------文件大小
2:MP3 格式声音 -----文件类型
3:2008-9-3 12:58 -----修改时间
4:2008-8-26 11:44 ------创建时间
5:2008-9-3 12:58 ------访问时间
6:A
7:在线
8:Administrators
9:谭晶 -------作者
10:一起飞 -------标题
11:
12:Pop -----------流派
13:
14:思恒网—新闻工作者的摇篮!ww -------备注
15:
16:谭晶 -----艺术家
17:北京2008奥运会歌曲专辑 -----唱片标题
18:2008 -----发行年
19:20 ------曲目号码
20:Pop -----流派
21:0:04:21 ------持续时间
22:128kbps ------比特率
23:否 -----受保护
24:
25:
26:
27:
28:
29:
30:
31:
32:0 位
33:44 kHz ------音频采样级别
34:2 (立体声) -------频道
35:
相关文章推荐
- C#获取文件详细备注信息
- C# (asp.net) 获取文件详细备注信息
- C#获取文件详细备注信息
- C#获取FTP文件详细备注信息
- C#通过shell32获取文件详细备注信息
- C#获取文件详细备注信息,MP3的Tag等等
- C#获取文件详细备注信息
- 用C#和WMI获取逻辑驱动器详细信息(驱动器类型,文件系统,剩余空间等)
- 获取文件属性中详细信息里的各项目(vb 学习备注)
- C#递归获取所有目录下的文件信息并生成对应的XML件
- C# 获取文件大小,创建时间,文件信息,FileInfo类的属性表
- C# 获取文件信息并导出Excel,Xml报表
- C#文件基本操作2-获取文件基本信息
- C# 获取文件信息并导出Excel,Xml报表
- VB.Net 获取文件详细信息(版本、公司等)
- C# 获取 mp3文件信息(tag信息)
- 获取dataview显示的文件的详细信息
- C#获取文件版本信息
- c#通过oledb获取excel文件表结构信息
- C# 获取文件大小,创建时间,文件信息,FileInfo类的属性表