Well, based on your question you know the line number, so do something like this:
var lines = File.ReadAllLines("path to file");
lines[31] = "some value";
File.WriteAllLines("path to file", lines);
the first line of code gets you all the lines of a file into an array. The second line clearly sets thy known line to some value, and the third line overwrites the file with the new set of lines.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…