Shell32获取视频信息
来源:互联网 发布:阿里云推荐码在哪里看 编辑:程序博客网 时间:2024/06/06 11:37
public static string GetMediaDuration(string path)
{
var width = 0;
var height = 0;
ShellClass sh = new ShellClass();
Folder dir = sh.NameSpace(Path.GetDirectoryName(path));
FolderItem item = dir.ParseName(Path.GetFileName(path));
//字典存放属性名和属性值的键值关系对
Dictionary<string, string> Properties = new Dictionary<string, string>();
int i = 0;
while (true)
{
//获取属性名称
string key = dir.GetDetailsOf(null, i);
if (string.IsNullOrEmpty(key))
{
//当无属性可取时,推出循环
break;
}
//获取属性值
string value = dir.GetDetailsOf(item, i);
//保存属性
Properties.Add(key, value);
if (key == "帧高度")
{
height = Convert.ToInt32(value);
}
if (key == "帧宽度")
{
width = Convert.ToInt32(value);
}
if (width != 0 && height != 0)
{
return width + "," + height;
}
i++;
}
return "";
}
{
var width = 0;
var height = 0;
ShellClass sh = new ShellClass();
Folder dir = sh.NameSpace(Path.GetDirectoryName(path));
FolderItem item = dir.ParseName(Path.GetFileName(path));
//字典存放属性名和属性值的键值关系对
Dictionary<string, string> Properties = new Dictionary<string, string>();
int i = 0;
while (true)
{
//获取属性名称
string key = dir.GetDetailsOf(null, i);
if (string.IsNullOrEmpty(key))
{
//当无属性可取时,推出循环
break;
}
//获取属性值
string value = dir.GetDetailsOf(item, i);
//保存属性
Properties.Add(key, value);
if (key == "帧高度")
{
height = Convert.ToInt32(value);
}
if (key == "帧宽度")
{
width = Convert.ToInt32(value);
}
if (width != 0 && height != 0)
{
return width + "," + height;
}
i++;
}
return "";
}
0 0
- Shell32获取视频信息
- 使用shell32.dll获取浏览器相关信息
- 获取音、视频时长(NAudio,Shell32,FFmpeg)
- C#通过shell32获取文件详细备注信息
- 几种获取音视频播放时间长度的方法( shell32, WMP, ffmpeg )
- Java获取视频信息
- 获取土豆视频信息函数
- php 获取YouTube视频信息
- php 获取YouTube视频信息
- MediaInfo库获取视频信息
- java获取视频的信息
- 获取视频图像的信息
- .net根据视频地址获取视频信息
- android获取音频、视频、图片信息
- android获取视频头一帧,music信息
- android获取视频头一帧,music信息
- android获取音频、视频、图片信息
- 获取优酷视频信息json格式
- input 中文字如何上下居中
- android JNI utils/Log.h 找不到 解决方法(android jni 控制台信息输出)
- 【leetcode】Construct Binary Tree from Preorder and Inorder Traversal
- 把Apache Httpd 转换为系统服务
- 生命,早已千疮百孔
- Shell32获取视频信息
- C++文件读写详解(ofstream,ifstream,fstream)
- FFMPEG架构分析
- linux strsep字符串分割
- 谢谢你,不曾离开我
- mysql 中函数的混合使用
- OpenCV 通过 MFC 的 Picture Control 控件操作图像
- 美国“鼠女”放生数千老鼠 旧金山成鼠城
- Creating, detaching, re-attaching, and fixing a SUSPECT database