50,528
社区成员
发帖
与我相关
我的任务
分享
System.runFinalizersOnExit(true);
ActiveXComponent mf=new ActiveXComponent( "MailServerCtrl.MailDBInterface ");//找到组件
Object myCom=mf.getObject();//生成一个对象
Dispatch.call(myCom,method,param...);
//example
Dispatch.call(myCom, "AddUser/方法 ", "参数1 ", "参数2 ", "参数3 ");
public class Winmail {
static{
System.loadLibrary("MailServerCtrl");
}
public native String GetDBPath();
public static void main(String[] args) {
Winmail win = new Winmail();
System.out.println(win.GetDBPath());// java.lang.UnsatisfiedLinkError
}
}
<script language="JavaScript">
var temp = new ActiveXObject("MailServerCtrl.MailDBInterface");
temp.InitControl("E:\\htdocs\\Winmail\\server");// 设置路径,必须要!!!
alert(temp.checkUser("test6", "test.com"));// 查看是否存在
temp.addUser("test6", "test.com", "123456");// 新增
alert("成功");
alert(temp.checkUser("test6", "test.com"));// 查看是否存在
</script>