我有个外部的ycode.dll,我在asp.net 中就是引用不了,弹出错误的对话框,说是找不到该dll。我在网上找了一大堆资料,也都试了,绝对路径,甚至放在系统system32 下面 都没有用。。
我把代码[贴出来,今天就在这等了,解决后立即结贴using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;using System.Runtime.InteropServices;
public partial class _Default : System.Web.UI.Page
{
[DllImport("ycode.dll", EntryPoint = "loadcode", SetLastError = true, ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
public static extern int loadcode(int i, int j, string str, string enjoy);
[DllImport("ycode.dll", EntryPoint = "Recognition")]
public static extern int Recognition(int i, int j, int a, string str, string enjoy, int b, int c, int d); [DllImport("ycode.dll", EntryPoint = "Recognitiond")]
public static extern string Recognitiond(int i, int j, int a, string str, string enjoy); [DllImport("ycode.dll", EntryPoint = "lstrcpy")]
public static extern int lstrcpy(string enjoy, int i); [DllImport("ycode.dll", EntryPoint = "Writepic")]
public static extern int Writepic(string str);
protected void Page_Load(object sender, EventArgs e)
{
tb.Text = loadcode(0, 0, "例子1.fc", "enjoy-soft").ToString();
} protected void Button1_Click(object sender, EventArgs e)
{
tb.Text = loadcode(0, 0, "例子1.fc", "enjoy-soft").ToString();
} protected void Button2_Click(object sender, EventArgs e)
{
//识别,可以根据自己需要设定参数,本例没有输入必须参数,所以采用内部方式读取。 tb.Text = Recognitiond(1, 0, 0, "", "");
//把图片保存在 c:\code.bmp 以便在控件中显示。
Writepic("");
//Image1.Picture.LoadFromFile ("c:\\code.bmp");
imag.ImageUrl = "c:\\code.bmp";
}
}
我把代码[贴出来,今天就在这等了,解决后立即结贴using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;using System.Runtime.InteropServices;
public partial class _Default : System.Web.UI.Page
{
[DllImport("ycode.dll", EntryPoint = "loadcode", SetLastError = true, ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
public static extern int loadcode(int i, int j, string str, string enjoy);
[DllImport("ycode.dll", EntryPoint = "Recognition")]
public static extern int Recognition(int i, int j, int a, string str, string enjoy, int b, int c, int d); [DllImport("ycode.dll", EntryPoint = "Recognitiond")]
public static extern string Recognitiond(int i, int j, int a, string str, string enjoy); [DllImport("ycode.dll", EntryPoint = "lstrcpy")]
public static extern int lstrcpy(string enjoy, int i); [DllImport("ycode.dll", EntryPoint = "Writepic")]
public static extern int Writepic(string str);
protected void Page_Load(object sender, EventArgs e)
{
tb.Text = loadcode(0, 0, "例子1.fc", "enjoy-soft").ToString();
} protected void Button1_Click(object sender, EventArgs e)
{
tb.Text = loadcode(0, 0, "例子1.fc", "enjoy-soft").ToString();
} protected void Button2_Click(object sender, EventArgs e)
{
//识别,可以根据自己需要设定参数,本例没有输入必须参数,所以采用内部方式读取。 tb.Text = Recognitiond(1, 0, 0, "", "");
//把图片保存在 c:\code.bmp 以便在控件中显示。
Writepic("");
//Image1.Picture.LoadFromFile ("c:\\code.bmp");
imag.ImageUrl = "c:\\code.bmp";
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货