我写的报异常:RegistryKey r = new RegistryKey(RootKey.HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\");
if(r.hasSubkeys()) {
Iterator i = r.subkeys();
int count=1;
while(i.hasNext()) {
RegistryKey x = (RegistryKey)i.next();
//System.out.println(x.getName().toString());
// System.load("jRegisTryKey");
if(x.hasValue("DisplayName"))
{
System.out.println("软件名称:"+x.getValue("DisplayName").toString());
System.out.println("版本号:"+x.getValue("DisplayVersion"));
System.out.println("卸载路径为:"+x.getValue("UninstallString"));
System.out.println("------------------------------------"+(count++));
}
}
}
java
if(r.hasSubkeys()) {
Iterator i = r.subkeys();
int count=1;
while(i.hasNext()) {
RegistryKey x = (RegistryKey)i.next();
//System.out.println(x.getName().toString());
// System.load("jRegisTryKey");
if(x.hasValue("DisplayName"))
{
System.out.println("软件名称:"+x.getValue("DisplayName").toString());
System.out.println("版本号:"+x.getValue("DisplayVersion"));
System.out.println("卸载路径为:"+x.getValue("UninstallString"));
System.out.println("------------------------------------"+(count++));
}
}
}
java
Exception in thread "main" ca.beq.util.win32.registry.Win32Exception: 系统找不到指定的文件。 at ca.beq.util.win32.registry.RegistryKey.getValue(Native Method)
at com.zhongwang.RJSJ.Registry.GetInfo.getList(GetInfo.java:130)
at com.zhongwang.RJSJ.Registry.GetInfo.main(GetInfo.java:153)