using System.Runtime.InteropServices;
[DllImport(@"D:\CG_System\RedpassCrypt.dll")]//绝对路径提示找不到服务器
public static extern string enpass(string Str);
[DllImport("RedpassCrypt.dll")]//相对路径提示找不到dll文件public static extern string enpass(string Str);
TextBox2.Text = enpass(TextBox1.Text);//调用
放到Bin文件夹下也不行,这是个delphi编写的非托管dll,就这一个,好像也没有相关的dll没拷进来。到底要怎么引用啊!!!老大们知道的帮帮忙!
------解决方案--------------------------------------------------------
[DllImport("RedpassCrypt.dll"),CharSet = CharSet.Auto]
public static extern string enpass(string Str);
加入charset后就可以了,但是输出值是乱码@@