

Try to keep this entry ini file and then try to read section COR, against key VALUE. Be sure what you are doing, as it will modify the keys and values of INI.Ĭurrently the buffer limit is up to 2000 characters, which can be increased according to the requirement.Īfter setting the INI file name just as the following code, you can proceed with using CIniReader functions: If key not already present, update key value will create the specified key-value pair in the INI file. Update Key Value will update the modified value from the key value edit box for the key. Specifying a key name and pressing the Show Key Value button will display the value of the key. Specifying any of the section names, and clicking the List Keys buttons will fill the second list box with the section data (all key and value pairs).

List Sections fills the list of sections in the INI file. It takes from the user the fully qualified path and name of the INI file as C:\WINDOWS\ODBC.INI in the INI File name edit box. lists to keep sections and section dataĭemo project shows how to use the class. give the key value for the specified key of a sectionĬString getKeyValue(CString strKey,CString strSection)


updates the key value, if key already exists, // else creates a key-value pair long setKey(CString strValue, CString strKey, CString strSection) check if the section exists in the file methods to return the lists of section data and section namesĬStringList* getSectionData(CString strSection) method to set INI file name, if not already specified void setINIFileName(CString strINIFile) Copy Code // // CIniReader- Header File // class CIniReader
