0
我们为Notes 8.5.2开发了一个自定义插件。它记录了许多自定义用户首选项。那这样做的类如下所示:注释插件:自定义用户设置存储在哪里?
import java.util.prefs.Preferences;
/**
* Provides programmatic access to Windows Registry entries for this plug-in.
*/
public class Registry
{
Preferences prefs;
/**
* Initializes a new instance of the Registry class.
*/
public Registry()
{
prefs = Preferences.userNodeForPackage(Registry.class) ;
}
/**
* Gets the value of a registry key.
*
* @param keyName The name of the key to return.
*
* @return A string containing the value of the specified registry key. If a key with the specified name cannot be
* found, the return value is an empty string.
*/
public String GetValue(String keyName)
{
try
{
return prefs.get(keyName, "NA") ;
}
catch(Exception err)
{
return "" ;
}
}
/**
* Sets the value of a registry key.
*
* @param keyName The name of the registry key.
*
* @param keyValue The new value for the registry key.
*/
public void SetValue(String keyName, String keyValue)
{
try
{
prefs.put(keyName, keyValue);
prefs.flush();
}
catch(Exception err)
{
}
}
}
使用它是如下的代码示例:
Registry wr = new Registry();
String setting1 = wr.GetValue("CustomSetting1");
wr.SetValue("CustomSetting1", newValue);
现在,我已经扫描Windows注册表,而且这些设置不存在。我已经索引了我的整个硬盘,并且我无法在任何文件中找到这些条目。
那么,这些设置存储在哪里?
当然够了,那就是他们所在的地方。他们被怪异地命名。非常感谢! –