共找到2條詞條名為JNA的結果 展開
- 其他
- 簡單示例
JNA
簡單示例
嘗試調用TestCode.dll庫中的String _SetUserName(String name)方法,方法返回設置的name
目錄
public class JavaApplication1 { public JavaApplication1() { } public interface TestLibrary extends Library { TestLibrary INSTANCE = (TestLibrary) Native.loadLibrary("TestCode", TestLibrary.class); public String _SetUserName(String value); } public static void main(String[] args) { try { System.out.println(TestLibrary.INSTANCE._SetUserName("111")); } catch (Exception e) { e.printStackTrace(); } }}