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);