简体   繁体   English

使用(C#,mpr.dll)访问网络驱动器文件时出错:无法加载DLL'mrp.dll'

[英]Error while accessing network drive file using (C#, mpr.dll) : Unable to load DLL 'mrp.dll'

I am trying to access a file from network drive through C# using @boskop 's solution found here . 我正在尝试使用此处找到的@boskop的解决方案通过C#从网络驱动器访问文件。

There's a part where we will have to import this windows dll 有一部分我们将必须导入此Windows dll

[DllImport("mrp.dll")] [的DllImport( “mrp.dll”)]

And here's the error I get: 这是我得到的错误:

Unable to load DLL 'mrp.dll': The specified module could not be found. 无法加载DLL'mrp.dll':找不到指定的模块。 (Exception from HRESULT: 0x8007007E) (来自HRESULT的异常:0x8007007E)

Any ideas on the cause of the error and its solution? 关于错误原因及其解决方案的任何想法?

The solution is found... It was a type as Hans pointed and the .dll had to be put along side the assembly as rbm pointed ... I would like to leave the question unedited... it might help some other afflicted programmer like me.. :D 找到了解决方案...这是Hans指出的类型,.dll必须像rbm指出的那样放在程序集的旁边...我想不做任何编辑的问题...这可能会帮助其他受苦的程序员像我一样..:D

Well you can copy the desired dll ( mpr.dll ) to your local assembly folder, then follow steps as shown in below image. 好了,您可以将所需的dll( mpr.dll )复制到本地程序集文件夹,然后按照下图所示的步骤进行操作。

  1. In your solution explorer, right click at References , and pick Add Reference . 在您的解决方案资源管理器中,右键单击“ References ,然后选择“ Add Reference
  2. It will open another window, from here, you can browse your DLL. 它将打开另一个窗口,从这里可以浏览DLL。 Give the location and Add. 给出位置并添加。
  3. Now write [DllImport("mpr.dll")] 现在写[DllImport("mpr.dll")]

在此处输入图片说明

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

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