Alıntı
static void lineChanger(string newText, string fileName, int line_to_edit) {
string[] arrLine = File.ReadAllLines(fileName);
arrLine[line_to_edit - 1] = newText;
File.WriteAllLines(fileName, arrLine);
}
Ornek :

Alıntı
lineChanger("new content for this line" , "sample.text" , 34); // 34. satir
Kaynak : https://stackoverflow.com/questions/...ile-in-c-sharp