码迷,mamicode.com
首页 > 编程语言 > 详细

java调用com组件com4j

时间:2019-09-30 18:14:01      阅读:86      评论:0      收藏:0      [点我收藏+]

标签:-o   tor   ever   public   obj   mic   color   ring   test   

com4j

A Java library that allows Java applications to seemlessly interoperate with Microsoft Component Object Model.

First generate Java type definitions from a COM type library. Here we are doing for the type library for the Windows Scripting Host.

> java -jar tlbimp.jar -o wsh -p test.wsh %WINDIR%\system32\wshom.ocx

 代码:

public class Main {
  public static void main(String[] args) {
    IFileSystem3 fs = ClassFactory.createFileSystemObject();
    for( String file : args )
      System.out.println(fs.getFileVersion(file));
  }
}

 

java调用com组件com4j

标签:-o   tor   ever   public   obj   mic   color   ring   test   

原文地址:https://www.cnblogs.com/nanfei/p/11613665.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!