C# StreamWriter写入一个ini文件到本地,StreamReader读取保存在本地的ini文件内容

 写入:

  StreamWriter s = new StreamWriter(address + "\\Menu.ini", true);
            s.WriteLine("这里是具体的内容");//写入INI文件
            s.Flush();
            s.Close();

读取:

  StreamReader sr = new StreamReader(address + "\\Menu.ini");
            string[] arrstr = sr.ReadToEnd().Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);

 

posted @ 2013-12-19 11:14  JasonGu0  阅读(687)  评论(0编辑  收藏  举报