Board logo

Subject: 建议在 "INI读写单元向导" 中增加部分内容。 [Print This Page]

Author: Net2k    Time: 2015-5-18 00:24     Subject: 建议在 "INI读写单元向导" 中增加部分内容。

我一般会在生成的文件后增加这样一段,能不能直接放到里面去?

initialization
  IniOptions := TIniOptions.Create;
  AppPath := ExtractFilePath(Application.Exename);
  IniOptions.LoadFromFile(AppPath + ChangeFileExt(ExtractFileName(Application.ExeName), '.ini'));

finalization
  IniOptions.SaveToFile(AppPath + ChangeFileExt(ExtractFileName(Application.ExeName), '.ini'));
  IniOptions.Free;
Author: Passion    Time: 2015-5-18 11:08

加载和存还是留给操作者自己控制吧,万一他不想结束时自动存呢。




Welcome to CnPack Forum (http://bbs.cnpack.org/) Powered by Discuz! 5.0.0