java操作控件加密

ActiveXcomponentInit.java

 1 import com.jacob.activeX.ActiveXComponent;
 2 
 3 public class ActiveXcomponentInit {
 4 
 5     public static ActiveXComponent getActiveXcomponentInit(){
 6         ActiveXComponent activeX= new ActiveXComponent(Keys.ACTIVEXCOMPONENT);
 7         return activeX;
 8          
 9     }
10     public static ActiveXComponent getActiveXcomponentInits(){
11         ActiveXComponent activeX= new ActiveXComponent(Keys.ACTIVEXCOMPONENTS);
12         return activeX;
13          
14     }
15 
16 }

调用:

1                 ActiveXComponent app = ActiveXcomponentInit
2                         .getActiveXcomponentInit();
3                 Dispatch ob = (Dispatch) app.getObject();
4                 Variant Udecry = Dispatch.call(ob, "decry_card", tcardEntity
5                         .getCardPsw());//调用decry_card函数
6                 String pass = Udecry.getString();
原文地址:https://www.cnblogs.com/qsl568/p/3651542.html