开发者

is there a function or unit sames as TIniFiles that will not save to file?

I have a project that use Inifile for reading the data configuration.

I decided to save the confi开发者_StackOverflow社区guration to the resource.

i would like to ask help if is there a Unit or function that same as Tinfile or related that saving the data config is optional.

any suggestions aside from extraction?

thanx.


TMemIniFile is what you need and should always be preferred to TIniFile. You choose whether or not to save to file.

What you can't do directly is initialize it from a resource, but it's not too hard to put it together yourself.

  1. Use a resource stream to extract your resource.
  2. Create a string list and call load your resource stream into the string list.
  3. Create a TMemIniFile and call SetStrings passing the string list.


There is a class named TMemIniFile that only saves the changes to the inifile when you call UpdateFile. Is that good enough for you?


TMemIniFile (descendant of TCustomIniFile) will not save unless you tell it to UpdateFile;

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜