当前位置: 代码迷 >> Delphi >> asp.net网站如何调用delphi编写的dll文件
  详细解决方案

asp.net网站如何调用delphi编写的dll文件

热度:429   发布时间:2013-02-25 00:00:00.0
asp.net网站怎么调用delphi编写的dll文件?
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后就可以了,但是输出值是乱码@@

  相关解决方案