JNA[簡單示例]

JNA[簡單示例]
更多義項 ▼ 收起列表 ▲

嘗試調用TestCode.dll庫中的String _SetUserName(String name)方法,方法返回設定的name

publicclassJavaApplication1{publicJavaApplication1(){}/***@paramargsthecommandlinearguments*/publicinterfaceTestLibraryextendsLibrary{TestLibraryINSTANCE=(TestLibrary)Native.loadLibrary("TestCode",TestLibrary.class);publicString_SetUserName(Stringvalue);}publicstaticvoidmain(String[]args){try{System.out.println(TestLibrary.INSTANCE._SetUserName("111"));}catch(Exceptione){e.printStackTrace();}}}

熱門詞條

聯絡我們