The article that Mehdi Gholam refers you to is an excellent source for "going deep" into analyzing differences.
For the simple purpose of finding what strings in one Text File are
not in the strings in another Text File, you can use a pretty simple technique:
using System.IO;
using System.Linq;
string originalPath = @"";
string revisionPath = @"";
private void SomeButton_Click(object sender, EventArgs e)
{
string[] InRevisionNotInOriginal = LineDiff(originalPath, revisionPath).ToArray();
string[] InOriginalNotInRevision = LineDiff(revisionPath, originalPath).ToArray();
}
public static IEnumerable<string> LineDiff(string originalPath, string revisionPath)
{
if (File.Exists(originalPath) && File.Exists(revisionPath))
{
return File.ReadAllLines(revisionPath).Except(File.ReadAllLines(originalPath));
}
else
{
throw new FileNotFoundException("Bad File Path");
}
}
Where analyzing "difference" gets interesting is when you want to detect when an element in source1 has been moved to a different position in source2; and, when you want to detect changes in the total number of duplicate value elements.