Unit unit1; interfaceuses windows, messages, sysutils, variants, classes, graphics, controls, forms, dialogs, stdctrls; Type tform1 = Class (tform) button1: tbutton; button2: tbutton; procedure formcreate (Sender: tobject); Procedure formdestroy (Sender: tobject); Procedure button1click (Sender: tobject); Procedure button2click (Sender: tobject ); private {private Declarations} public {public declarations} end; var form1: tform1; implementation {$ R *. DFM} uses inifiles; var ini: tmeminifile; Procedure tform1.formcreate (Sender: tobject); begin ini: = tmeminifile. create ('C: \ temp \ test. INI '); end; // write procedure tform1.button1click (Sender: tobject); begin ini. writestring ('aaa', 'a1', 'aaa-string'); // use the same as INIFILE. // ini. writeinteger (); // ini. writebool (); // ini. writedate (); // ini. writetime (); // ini. writedatetime (); // ini. writefloat (); // ini. writebinarystream (); // ini. updatefile; // because tmeminifile is a memory operation, it can be saved to the file end; // read and other procedure tform1.button2click (Sender: tobject); var S: string; begin s: = ini. readstring ('aaa', 'a1', 'default '); showmessage (s); // AAA-string // other read commands use the same as INIFILE // ini. readinteger (); // ini. readbool (); // ini. readdate (); // ini. readtime (); // ini. readdatetime (); // ini. readfloat (); // ini. readbinarystream (); // There are four common methods as well as INIFILE // ini. deletekey (); // ini. erasesection (); // ini. readsection (); // ini. readsections (); // the other three INIFILE methods are also easy to use. // ini. getstrings (list: tstrings); // ini. setstrings (list: tstrings); // ini. rename (const filename: string; reload: Boolean); // if the second Boolean parameter in rename is true, it will be refreshed and read into end; Procedure tform1.formdestroy (Sender: tobject ); begin ini. free; end.