using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace test2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
[DllImport("ez2000.dll", EntryPoint = "openport")]
public extern static void openport(string port);
private void button1_Click(object sender, EventArgs e)
{
string strlll = "5";
openport(strlll);
}
}
}
错误:{"无法加载 DLL“ez2000.dll”: 找不到指定的模块。 (异常来自 HRESULT:0x8007007E)。"}
我把dll文件放exe一起,还复制了一份放system32下了
这个是dll的说明文档1. openport
Description: select the output port
Command: openport(no)
Input parameters: no: (string) output port ref.
“0” = LPT1
“1” = COM1
“2” = COM2
“3” = COM3
“4” = COM4
“5” = LPT2
“6” = USB
参考资料:如果您的回答是从其他地方引用,请表明出处