Delphi reading and writing to the INI file

xiaoxiao2021-03-06  62

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-119062.html

New Post(0)