waterye

          Groovy Com Scripting

          使用Scriptom和Jacob在groovy調用ActiveX 或 COM component(只能在Windows下運行)

          需要的jar和dll
          a. groovy-all-1.0-jsr-03.jar,jacob.jar,jacob.dll,asm.jar
          b. jacob.dll needs to be in the bin directory, or in your java.library.path

          ie.groovy
          import org.codehaus.groovy.scriptom.ActiveXProxy

          // instanciate Internet Explorer
          explorer = new ActiveXProxy("InternetExplorer.Application")

          // set its properties
          explorer.Visible = true
          explorer.AddressBar 
          = true

          // navigate to a site
          explorer.Navigate("http://waterye.blogjava.net")
          Thread.sleep(
          1000)
          explorer.StatusText 
          = "Water Ye's blog"
          Thread.sleep(
          2000)

          // quit Internet Explorer
          explorer.Quit()


          測試環境:
          1. scriptom:groovy_cvs\modules\scriptom
          2. ide:        groovyj
          3. jdk:       jdk1.5.0_01

          詳細版本: http://groovy.codehaus.org/COM+Scripting

          posted on 2005-09-10 22:36 waterye 閱讀(737) 評論(0)  編輯  收藏 所屬分類: groovy

          主站蜘蛛池模板: 静安区| 金寨县| 房山区| 于田县| 基隆市| 电白县| 河西区| 江油市| 浏阳市| 轮台县| 吉安县| 黄梅县| 宣威市| 景洪市| 台中县| 曲阳县| 望都县| 云南省| 太谷县| 锦屏县| 察雅县| 正阳县| 什邡市| 上虞市| 宜兴市| 焉耆| 元氏县| 商洛市| 恩施市| 嘉义县| 德兴市| 拉孜县| 正镶白旗| 民勤县| 光泽县| 崇左市| 正定县| 迁安市| 大宁县| 桦甸市| 改则县|