📅  最后修改于: 2022-03-11 14:48:42.204000             🧑  作者: Mango
var sourceFile = "text.txt";
var targetFile = @"C:\Users\Tomas\Desktop\MovieStarz\MovieStarz\WriteText.txt";
var id = App.Moviess.Filmerna[index].id.ToString();
var lines = File.ReadAllLines(sourceFile)
.Where(l => l.Contains(id))
.ToArray();
File.AppendAllLines(targetFile, lines);