文字列が比較される場合、txtファイルで文字列を見つけたいのですが、パラメーターとして使用している別の文字列まで行を読み続ける必要があります。
例:
CustomerEN //search for this string
...
some text which has details about the customer
id "123456"
username "rootuser"
...
CustomerCh //get text till this string
それ以外の場合は、詳細が必要です。
次のようにlinqを使用して「CustomerEN」を検索しています。
File.ReadLines(pathToTextFile).Any(line => line.Contains("CustomerEN"))
しかし、今は「CustomerCh」まで行 (データ) を読み取って詳細を抽出することにこだわっています。