使用Directory.GetFiles("路径", "*.bbb", SearchOption.AllDirectories);
Directory.GetFiles("路径", "*.aaa", SearchOption.AllDirectories);
StreamReader sr = new StreamReader("路纤御备径", Encoding.UTF8);
int i = 0;
string 你要的拆逗内容 = "";
while(sr.Peek()!=-1)
{
if (i == 3)
{
你要的内容 = sr.ReadLine(); break;
}
}
sr.Close();
//回写
StreamWriter sw = new StreamWriter("路径", Encoding.UTF8);
sw.Write("你的值");//此时你可以把原来的文件内容取毁毁出来整体替换,也可以循环到第三行才替换
sw.Flush();
sw.Close()