Answer the question
In order to leave comments, you need to log in
Why can't get data from the registry?
Hello! Faced a problem - unable to get a specific value from the registry
Reg:=TRegistry.Create;
Reg.RootKey := HKEY_CURRENT_USER;
Reg.OpenKey('\SOFTWARE\myapp' , true);
if Reg.ValueExists('cur_ver') then cur_ver := Reg.ReadString('cur_ver');
// cur_ver остается пустым, хотя я только что её создал в помощью другой программы.
// если написать вот так Reg.ReadString('u_name'); то я получаю значение
Answer the question
In order to leave comments, you need to log in
Miracles don't happen. Check the code for elementary typos. Maybe they renamed something somewhere. (Here in the question you have u_name, and in the picture UserName - maybe with the version as well) Your line reading from the register may either not find a value or consider it empty - check which option is yours. Maybe the program that writes to the registry has stopped writing. Etc.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question