如何在c#.net程序中读取Epson打印机的DLL [英] How ro read DLL of Epson printer in c#.net program

查看:176
本文介绍了如何在c#.net程序中读取Epson打印机的DLL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的项目中,对于某些任务,我必须阅读epson打印机DLL,而我尝试将其添加为引用时会出现错误消息:程序集格式不正确.谢谢您的帮助.

In my project for some task I have to read epson printers DLL, while I am trying to add it as reference it raises error message: assembly is not in suitable format. Thank you for help.

推荐答案

您只能添加对.NET和COM dll的引用. 我认为dll是C或C ++.将
You can only add a reference to .NET and COM dlls.
I assume the dll is C or C++. Add
using System.Runtime.InteropServices

添加到.cs文件的顶部.
您将需要在想要使用的dll中创建所有功能的C#版本,并使用[DllImport("dllname.dll")]属性修饰它们-当然,请指定正确的dll名称.

to the top of the .cs file.
You will need to create C# versions of all functions in the dll you wish to use and decorate them with the [DllImport("dllname.dll")] attribute - specifying the correct dll name of course.


这篇关于如何在c#.net程序中读取Epson打印机的DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆