|
I basically got it, although I don’t understand it, but I used the dll anyway.
UserKit is the name of the dll, clsRC4 is the module in the dll project, EncrytString and DecrytString are encryption and decryption methods, each method has two parameters: one is the original text (ciphertext), and the other is the key.
Of course, the process I did was not very understanding of Dispatch and Variant objects.
package jacob;
import com.jacob.activeX.ActiveXComponent;
import com.jacob.com.*;
public class Kit {
The
public static void main(String args[]){
ActiveXComponent app = new ActiveXComponent("UserKit.clsRC4");
Dispatch mycom = (Dispatch)app.getObject();
String s[] = new String[2];
s[0] = new String("ttt");
s[1] = new String("admin");
Variant result = Dispatch.callN(mycom, "EncryptString", s);
System.out.print(result);
String es[] = new String[2];
es[0] = new String("M2t");
es[1] = new String("admin");
Variant dresult = Dispatch.callN(mycom, "DecryptString",es);
System.out.print(dresult);
The
The
}
} |
|