博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

i-collabo笔记1

Posted on 2006-09-28 09:55  daniel-shen  阅读(319)  评论(0)    收藏  举报

1. 经常说的“one package two folder” 就是通过使用eclipse这个IDE建立两个目录,但是发布的目的目录一样,这样便于管理自己的项目,如建立测试代码体系。

2.一个jni的开源包registry.jar和ICE_JNIRegistry.dll,使用的时候注意java.library.path,必须将ICE_JNIRegistry.dll放到
 该变量指定的目录下,下面提供一份源码
import com.ice.jni.registry.NoSuchKeyException;
import com.ice.jni.registry.RegStringValue;
import com.ice.jni.registry.Registry;
import com.ice.jni.registry.RegistryException;
import com.ice.jni.registry.RegistryKey;
public class EditRegedit {
 public static void main(String args[])
 {
  try {
   RegistryKey software = Registry.HKEY_LOCAL_MACHINE.openSubKey("SOFTWARE\\NEC\\CommDoorExpress");
   RegistryKey subKey = software.createSubKey("Product", "");
      subKey.setValue(new RegStringValue(subKey, "no", "test"));
      subKey.closeKey(); 
  } catch (NoSuchKeyException e) {
   // TODO Auto-generated catch block
   e.printStackTrace();
  } catch (RegistryException e) {
   // TODO Auto-generated catch block
   e.printStackTrace();
  }
 
 }
}