GetDetailsOf函数使用Shell32.Shell返回空字符串,在本地机器上工作正常

编程入门 行业动态 更新时间:2024-10-12 05:51:10
本文介绍了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返回空字符串,在本地机器上工作正常

本文发布于:2023-11-05 18:24:15,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1561540.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:函数   工作   空字符串   机器上   GetDetailsOf

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!