查注册表:
HKEY_CURRENT_USER/Control Panel/International下的键值
sShortDate,sTime,sTimeFormat等
一段修改系统当前日期时间格式的代码:
var
Now_Reg : TRegistry;
Now_Reg := TRegistry.create;
try
with Now_Reg do
begin
RootKey := HKE_Current_User;
OpenKey('',false);
OpenKey('Control Panel/International',false);
WriteString('sDate','/');
WriteString('sShortDate','YYYY/MM/DD');
RootKey := HKEY_USERS;
OpenKey('',false);
OpenKey('.Default/Control Panel/International',false);
WriteString('sDate','/');
WriteString('sShortDate','YYYY/MM/DD');
end;
finally
Now_Reg.Free;
end;
当然,能写自然也能读了,读可用ReadString()方法