简体   繁体   English

在C#项目中使用MediaInfo.dll

[英]Using the MediaInfo.dll within C# project

I am attempting to use the MediaInfo.dll within an MVC4 project designed in c# but I am having difficulty in getting this working. 我正在尝试在用C#设计的MVC4项目中使用MediaInfo.dll,但是我很难使它正常工作。 I found the following page: http://teejeetech.blogspot.co.uk/2013/01/mediainfo-wrapper-for-net-projects.html and having followed the instructions I have hit a wall. 我找到了以下页面: http : //teejeetech.blogspot.co.uk/2013/01/mediainfo-wrapper-for-net-projects.html ,并且按照指示操​​作,我碰壁了。

I have added the MediaInfoNet.dll to my project and have downloaded the MediaInfo.dll in both 32 and 64 bit versions without installers and placed them in my system32 and sysWOW54 folders. 我已将MediaInfoNet.dll添加到我的项目中,并下载了32位和64位版本的MediaInfo.dll(没有安装程序),并将它们放置在我的system32和sysWOW54文件夹中。 I have then added the following code: 然后,我添加了以下代码:

MediaFile uploadedFile = new MediaFile("C:\\Users\\jpmcfeely\\Desktop\\Videos\\Quarry.mp4");
string duration = uploadedFile.General.DurationString.ToString();

When debugging through this I get the following error on MediaFile uploadedFile: 通过调试时,我在MediaFile uploadFile上收到以下错误:

An attempt was made to load a program with an incorrect format. 试图加载格式错误的程序。 (Exception from HRESULT: 0x8007000B) (来自HRESULT的异常:0x8007000B)

Any ideas what could be causing my issue? 任何想法可能导致我的问题吗?

Upgrade the DLL in your application bin folder to the 64 bit version of the dll available from http://mediaarea.net/en/MediaInfo/Download/Windows and choose the 64 bit without installer. 将应用程序bin文件夹中的DLL升级到可从http://mediaarea.net/en/MediaInfo/Download/Windows获得的DLL的64位版本,然后选择没有安装程序的64位。 This can be used with the MediaInfoNet dll and it correctly returns the duration string 可以与MediaInfoNet dll一起使用,它可以正确返回持续时间字符串

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM