⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 win32regkey.java

📁 sun公司开发的,java2核心技术,卷II:高级性能,包括一系列的高级java应用技术,如数据库德连接,高级swing,多线程,软件本地化等等,本文件中则包含该书中的所用实例,配合该书使用,使对ja
💻 JAVA
字号:
/**
 * @version 1.00 1997-07-01
 * @author Cay Horstmann
 */

import java.util.*;

public class Win32RegKey
{  public Win32RegKey(int theRoot, String thePath)
   {  root = theRoot;
      path = thePath;
   }
   public Enumeration names()
   {  return new Win32RegKeyNameEnumeration(root, path);
   }
   public native Object getValue(String name);
   public native void setValue(String name, Object value);

   public static final int HKEY_CLASSES_ROOT = 0x80000000;
   public static final int HKEY_CURRENT_USER = 0x80000001;
   public static final int HKEY_LOCAL_MACHINE = 0x80000002;
   public static final int HKEY_USERS = 0x80000003;
   public static final int HKEY_CURRENT_CONFIG = 0x80000005;
   public static final int HKEY_DYN_DATA = 0x80000006;

   private int root;
   private String path;

   static
   {  System.loadLibrary("Win32RegKey");
   }
}

class Win32RegKeyNameEnumeration implements Enumeration
{  Win32RegKeyNameEnumeration(int theRoot, String thePath)
   {  root = theRoot;
      path = thePath;
   }

   public native Object nextElement();
   public native boolean hasMoreElements();

   private int root;
   private String path;
   private int index = -1;
   private int hkey = 0;
   private int maxsize;
   private int count;
}

class Win32RegKeyException extends RuntimeException
{  public Win32RegKeyException() {}
   public Win32RegKeyException(String why)
   {  super(why);
   }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -