本文转自:http://www.cnblogs.com/zhusimu/archive/2008/07/12/1241439.html


在网上找了关于ini文件读写方法,还是没有找到ini文件中有一个Section多个Key的读写情况,在一篇C++文章中得到点提示操作如下:
1.创建ini文件读写类:
【转】C#中读写INI文件using System.Runtime.InteropServices;
【转】C#中读写INI文件
using System.Text;
【转】C#中读写INI文件
【转】C#中读写INI文件
namespace INIDemo

2.测试INI文件读写
【转】C#中读写INI文件        //写入ini文件
【转】C#中读写INI文件
        private void button1_Click(object sender, EventArgs e)
        }

结果:
[Section1]
Key1=Key1's Value
[Section2]
Key2=Key2's Value
[UseFileName]
file1=value1
file2=value2
file3=value3
file4=value4



相关文章:

  • 2022-03-04
  • 2021-07-30
  • 2021-09-13
  • 2021-12-14
  • 2021-08-28
猜你喜欢
  • 2021-12-18
  • 2021-10-15
  • 2021-12-24
  • 2022-02-26
  • 2022-12-23
  • 2021-12-30
相关资源
相似解决方案