这种个人认为其实都是文本文件,只不过格式不一样了。很遗憾配置文件我用得很低端,我自己用的大多就是文件流(简单粗暴)。对于INI,我似乎只能给出以下方法:[System.Runtime.InteropServices.DllImport("kernel32")]private static extern long WritePrivateProfileString(string section, string key, string val, string filePath);[System.Runtime.InteropServices.DllImport("kernel32")]private static extern int GetPrivateProfileString(string section, string key, string def, System.Text.StringBuilder retVal, int size, string filePath);//读写示例方法void demo(){StringBuilder demos = new StringBuilder (255);WritePrivateProfileString ("section", "name", "theDemo", @"D:\theDemoini.ini");GetPrivateProfileString ("section" , "name" ,"" ,demos,255 , @"D:\theDemoini.ini");print (demos);}