本帖最后由 herofour444 于 2013-01-30 21:46:14 编辑

解决方案 »

  1.   

    1、导入dll到工程的相对路径。
    2、生产dll的原生函数。就可以了。
    参考如下:
    public class TestNative {
    private native static int Max(int a, int b);
    private native static String GetLicense(String a); public static void main(String[] args) {
    TestNative license = new TestNative();
    System.out.println("lll:" + license.getMaxNum());
    System.out.println("hd:" + license.GetLicense());
    } static {

    System.loadLibrary("A3");
    } public int getMaxNum(){
    return Max(4, 5);
    }

    public String GetLicense(){
    return GetLicense("");
    }
    }