2012-10-09 91 views
-1

我的工作从使用SHELL32库.mp4档案检索数据。Folder.GetDetailsOf返回错误的项目类型

我在本地主机上工作的代码,但是当我在IIS服务器上使用它时,它将文件作为“MP4文件”而不是导致没有视频数据的“MP4视频”返回(宽度,高度,帧比率等)回来。

我读,我可以用GetDetailsEx才能得到正确的数据备份,但这种方法似乎并不在文件夹类存在。

public static ExtendedFilePropertiesMp4 GetExtendedFileProperties(string directory, string fileName) 
    { 
     Dictionary<string, int> headers = new Dictionary<string,int>(); 

     Shell shell = new Shell(); 
     Folder folder; 

     folder = shell.NameSpace(directory); 

     for (int i = 0; i < short.MaxValue; i++) 
     { 
      string header = folder.GetDetailsOf(null, i); 

      if (String.IsNullOrEmpty(header)) 
       break; 

      if (!headers.ContainsKey(header)) 
       headers.Add(header, i); 
     } 

     FolderItems folderItems = folder.Items(); 

     foreach (FolderItem2 item in folder.Items()) 
     { 
      if (folder.GetDetailsOf(item, 0) == fileName) 
      { 
       ExtendedFilePropertiesMp4 extendedFileProperties = new ExtendedFilePropertiesMp4(); 

       // Get data and set the properties of the extendFileProperties 

       return extendedFileProperties; 
      } 
     } 

     return null; 
    } 

在Web.config中是否存在一个设置或类似的我需要改变它的工作?

编辑:我知道我已经下来了投票,可以说做到了人民解释,为什么?我很想去阐述我的问题

回答

0

我是用什么本作是改变div标签是有它内部的视频标签的宽度和高度。

由于上述不工作,我发现这样做的另一种方式,这是通过使用等待loadedmetadata。

欲了解更多信息,看到这个答案: jQuery, checking to see if video has height/width