调用DLL问题
[DllImport( @"D:\\matt\\TestPrint\\TestPrint\\bin\\Debug\\BYNetPrn.dll", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
public static extern bool BTPNetWriteOpen(string _strIP, int connecttime, int writetime);
private void button3_Click(object sender, EventArgs e)
{
unchecked
{
bool m_bFlag = BTPNetWriteOpen("172.16.20.151", 5, 5);
MessageBox.Show(m_bFlag.ToString());
}
}
提示我
未处理的“System.DllNotFoundException”类型的异常出现在 TestPrint.exe 中。
其他信息: 无法加载 DLL“D:\\matt\\TestPrint\\TestPrint\\bin\\Debug\\BYNetPrn.dll”: 动态链接库(DLL)初始化例程失败。 (异常来自 HRESULT:0x8007045A)。
哪位高手帮助一下