日期:2014-05-17 浏览次数:20748 次
import com.sun.jna.Native;
import com.sun.jna.win32.StdCallLibrary;
public class DllGetCardno {
public interface JNATestDll extends StdCallLibrary {
JNATestDll instanceDll = (JNATestDll)Native.loadLibrary("libCCIDSource",JNATestDll.class);
public void GetLastErrInfo(String lastErr);
public int GetCardNumber(byte[] cardNumber);
}
}
public void init() {
System.out.println("init");
JNATestDll.instanceDll.GetCardNumber(a);
System.out.println("loaddll");
String cardnum = "";
for(int i = 0;i<a.length;i++){
if("0".equals(a[i])){
break;
}
if("48".equals(a[i])|| a[i]==48){
cardnum = cardnum+"0";
}else if("49".equals(a[i])|| a[i]==49){
cardnum = cardnum+"1";
}else if("50".equals(a[i])|| a[i]==50){
cardnum = cardnum+"2";
}else if("51".equals(a[i])|| a[i]==51){
cardnum = cardnum+"3";
}else if("52".equals(a[i])|| a[i]==52){
cardnum = cardnum+"4";
}else if("53".equals(a[i])|| a[i]==53){
cardnum = cardnum+"5";
}else if("54".equals(a[i])|| a[i]==54){
cardnum = cardnum+"6";
}else if("55".equals(a[i])|| a[i]==55){
cardnum = cardnum+"7";
}else if("56".equals(a[i])|| a[i]==56){
cardnum = cardnum+"8";
}else if("57".equals(a[i])|| a[i]==57){
cardnum = cardnum+"9";
}
}
System.out.println(cardnum);
}
<html>
<body>
<applet id="hh" alt="Applet" width="300" height="300"
code="publics.MyApplet.class"
archive="applet.jar,jna-3.5.1.jar,platform.jar"
codebase="." mayscript>
</applet>
</body>
</html>