日期:2014-05-17 浏览次数:20467 次
① 引用shell32底层接口c:windowssystem32shell32.dll,vs自动转换成interop.shell32.dll(注:64位系统和32位系统生成的interop.shell32.dll不一样) ② 编码读取播放时间长度: /// <summary> /// 获取媒体播放时间长度,格式00:00:00。 /// </summary> /// <param name="path">媒体路径</param> /// <returns>播放时间长度</returns> public static string getmediaduration(this string path) { try { shell32.shell shell = new shell32.shellclass(); shell32.folder folder = shell.namespace(path.substring(0, path.lastindexof("\"))); shell32.folderitem folderitem = folder.parsename(path.substring(path.lastindexof("\") + 1)); return folder.getdetailsof(folderitem, 21); } catch (exception ex) { ex.error(); return null; } }
------解决方案--------------------
http://butlandblog.appspot.com/log-14.html
获取 FLV的