本文介绍了GetDetailsOf函数使用Shell32.Shell返回空字符串,在本地机器上工作正常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好, 代码:
Hi All, Code:
int height = 0; int width = 0; Shell32.Shell Sh = new Shell32.Shell(); Shell32.FolderItem FI; Shell32.Folder F; F = Sh.NameSpace(System.IO.Path.GetDirectoryName(Server.MapPath("~/") + MovingImages + "caesarstonelongeng03142012063807596.mp4")); FI = F.ParseName(System.IO.Path.GetFileName(Server.MapPath("~/") + MovingImages + "caesarstonelongeng03142012063807596.mp4")); int.TryParse(F.GetDetailsOf(FI, 285), out width); int.TryParse(F.GetDetailsOf(FI, 283), out height);在我的本地机器(Windows 7)中,我得到: 高度 - 768 宽度 - 1024 但是上线后(Windows Server 2008 R2)我得到: 高度 - 0(返回空字符串) 宽度 - 0(返回空字符串) 请帮忙,我我坚持这个。
In my local machine (Windows 7) i get: Height - 768 Width - 1024 but after going live (Windows Server 2008 R2) i get: Height - 0 (return empty string) Width - 0 (return empty string) Please help, i am stuck at this.
推荐答案使用 GetDetailsEx 方法而不是 GetDetailsOf 。
检查您的服务器,可能是您必须安装Media Foundation功能 (Windows Server 2012:通过服务器管理器 - >添加角色和功能) Check your server, may be you have to install the Media Foundation feature (windows server 2012: through Server Manager -> add Roles and features)
有关此问题的任何更新?我面临同样的问题 Any updates about this issue ? im facing the same problem
更多推荐
GetDetailsOf函数使用Shell32.Shell返回空字符串,在本地机器上工作正常
发布评论