我正在尝试使用Preferences API在regedit中保存要文件的路径。它是工作的,但是路径的值没有被正确地保存。
我在试这个。
public class ImageLogoPreference {
private final String path = "configs";
private Preferences node;
public ImageLogoPreference(){
node = Preferences.userRoot().node(path);
}
public void setImageLogo(){
node.put("logo", "\\IguanaSistemas\\IguanaFight\\imagens\\logo.png");
}
public String getImageLogo(){
String logo = node.get("logo", "image");
return logo;
}
}在寄存器处保存这个:///Iguana/Sistemas///Iguana/Fight//imagens//logo.png

知道吗?
发布于 2014-08-18 23:48:51
这不重要。
把它放在Java程序中就行了。你没什么问题。
Preferences node = Preferences.userRoot().node("config");
//node.put("logo", "\\IguanaSistemas\\IguanaFight\\imagens\\logo.png");
String s = node.get("logo", "blah");
System.out.println(s);打印正确的字符串。
https://stackoverflow.com/questions/25373578
复制相似问题