There is only one place to pay attention to, that is, the key name or item name do not include uppercase letters, otherwise read data.
The code is like this:
Copy Code code as follows:
Preferences Preferences = Preferences.systemroot ();
String strregtime = Preferences.get ("Regtime", "");
This is the case in the registry
No matter how you change it, you can't read the value of Regtime. Then think of the code now to write the value in to see what it is, the code is as follows
Copy Code code as follows:
Preferences Preferences = Preferences.systemroot ();
Preferences.put ("Regtime", "2013-08-29 14:50:20");
try {
Preferences.flush ();
catch (Backingstoreexception e) {
TODO auto-generated Catch block
E.printstacktrace ();
}
String strregtime = Preferences.get ("Regtime", "");
It turns out it was.
So I found the problem, changed to lowercase ok.