Applet中修改注册表不清楚,是不是sign+JNI+C module?J2SE1.4中好象要增加注册表操作类

解决方案 »

  1.   

    Read the Registry
    public class RegistryRead {
     public static void main(String[] args) {
       RegistryRead demo = new RegistryRead();
       demo.doit();
       // IO.PressAnyKey();       
       }
        
     public void doit() {
       displayUserName();
       displayODBCDSN();
       }
        
     public void displayUserName(){
       com.ms.wfc.app.RegistryKey regKey;
       String userName;
       regKey =
         com.ms.wfc.app.Registry.LOCAL_MACHINE.getSubKey
           ("Network\\Logon");
       if (regKey == null) {
         userName = "Unable to get username from Registry!";
         }
       else {
         userName = (String) regKey.getValue("username");
         }
       System.out.println("Username : " + userName);
       } public void displayODBCDSN() {
       com.ms.wfc.app.RegistryKey regKey;
       regKey =
         com.ms.wfc.app.Registry.CURRENT_USER.getSubKey
           ("Software\\ODBC\\ODBC.INI\\ODBC Data Sources");
       if (regKey == null) {
         System.out.println("Unable to get ODBC DSN Registry!");
         }
       else {  
         String dsn [] = regKey.getValueNames();
         System.out.println("ODBC DSN defined : ");
         for(int i = 0;  i < dsn.length; i++) { 
           System.out.println(dsn[i]);
           }
         }
     }
    }
     
      

  2.   

    skyyoung:
    请问我怎么写入注册表呢?