Using System; using System. collections. generic; using System. linq; using System. text; using System. runtime. interopServices; using System. IO; namespace HelloCSharp {// [section] // key = value // class IniHelper {/// <summary> // path of the INI file /// </summary> private string filePath; [DllImport ("kernel32")] private static extern long WritePrivateProfileString (string section, string key, string val, string filePath); [DllImport ("kernel32")] private static extern int GetPrivateProfileString (string section, string key, string def, StringBuilder retVal, int size, string filePath); public IniHelper (string filePath) {this. filePath = filePath;} public void IniWriteValue (string section, string key, string val) {WritePrivateProfileString (section, key, val, filePath);} public string IniReadValue (string section, string key) {StringBuilder temp = new StringBuilder (500); GetPrivateProfileString (section, key, "", temp, 500, filePath); return temp. toString ();}}}