我想保存unicode字符串。有我有:爲什麼ini文件沒有被保存?
Uses IniFiles;
const
SZ_APP_NAME;
Procedure TForm1.SaveSettings;
var
_MemIniU: TMemIniFile;
SettingsPath: string;
begin
SettingsPath := GetHomePath + PathDelim + SZ_APP_NAME + PathDelim;
_MemIniU := TMemIniFile.Create(ChangeFileExt(SettingsPath, 'Settings.ini'),
TEncoding.UTF8);
try
if Form1.WindowState <> TWindowState.wsMaximized then
begin
_MemIniU.WriteInteger(SZ_APP_NAME, 'WindowLeft', Form1.Left);
_MemIniU.WriteInteger(SZ_APP_NAME, 'WindowTop', Form1.Top);
_MemIniU.WriteInteger(SZ_APP_NAME, 'WindowWidth', Form1.Width);
_MemIniU.WriteInteger(SZ_APP_NAME, 'WindowHeight', Form1.Height);
_MemIniU.WriteString(SZ_APP_NAME, 'UnicodeText', Edit1.Text);
end;
finally
_MemIniU.Free;
end;
end;
但ini文件不創建。我做錯了什麼? RAD Studio XE5。