访问Windows注册表

访问Windows注册表

本文介绍了访问Windows注册表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





有人帮我请...

I need to access Windows registry from Java.. Also I need to copy some registry entries and may have to enter new registry variables using Java..some one help me please...

推荐答案

我推荐。它是JNI的一个非常好的包装器。根据,他们已经有一个围绕本机Windows注册表函数调用的贡献包装器。

I'd recommend the Java Native Access (JNA) library. It's a pretty nice wrapper around JNI. According to this mailing list post, they've already got a contributed wrapper around the native Windows registry function calls.

如果将JNA库添加到项目中,。从那里,只需调用该类的方法来调查Windows注册表。

If you add the JNA libraries to your project, the relevant source you'll want is the Registry.java class. From there, just call methods on that class to investigate the Windows registry.

作为旁注,请确保在使用JNA时使用Platform.isXxx()确保您的代码可以实际查询特定平台上的注册表。

As a side note, make sure when you use JNA that you use Platform.isXxx() to make sure your code can actually query the registry on the particular platform.

这篇关于访问Windows注册表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 18:02