Read and write of the INI file

xiaoxiao2021-03-06  58

Uses inIfiles;

Function ReadiniFile (filename, section, ident: string): string; // Read configuration file var ini: tinifile; begin ini: = tinifile.create (filename); result: = ini.readstring (section, ide, '') Ini.free;

procedure writeInifile (const fileName, Section, Ident, Value: string); // write inifilevar ini: tinifile; aPathName: string; begin try aPathName: = ExtractFileDir (fileName); if not DirectoryExists (aPathName) then ForceDirectories (aPathName);

INI: = TiniFile.create (filename); ini.writestring (section, ide, value); ini.free; except end;

转载请注明原文地址:https://www.9cbs.com/read-119084.html

New Post(0)