winform INI文件操作辅助类
using System; using System.Runtime.InteropServices; using System.Text; namespace connectCMCC.Utils { /// <summary> /// INI文件操作辅助类 /// </summary> public class IniFileUtil { public string path; /// <summary> /// 传入INI文件路径构造对象 /// </summary> /// <param name="iniPath">INI文件路径</param> public IniFileUtil(string iniPath) { path = iniPath; } [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