我需要通过Win8在WinXP中读写一个配置文件到windows磁盘。他们在哪里做这件事的最佳地点?ProgramData 文件夹似乎不允许
procedure TfrmMain.FormCreate(Sender: TObject);
var
path: array[0..MAX_PATH] of char;
begin
SHGetFolderPath(0, CSIDL_COMMON_APPDATA, 0, SHGFP_TYPE_CURRENT, @path);
AppPath:= Path;
AppPath:= AppPath + '\Customer\';
if not DirectoryExists(AppPath) then
CreateDir(AppPath);
if FileExists(AppPath + 'Customers.cst') then
LoadFromFile(AppPath + 'Customers.cst');
end;
procedure TfrmMain.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
if ListModified then
begin
if MessageDlg('Save Changes?', mtWarning, [mbYes, mbNo], 0) = mrYes then
SaveToFile(AppPath + 'Customers.cst');
canClose:= True;
end
else
canClose:= False;
end;