I am writing an application that has a very loosely defined config file that is read in during startup. The file is easy to parse and looks something like the following:
tag1 = value1
tag2 = value2
tag3 = value3
tag4 = value4
with tags and values being the information that a user may want to configure. As I said previously, the file is loosely defined - AKA, I don't require all (or any) of the fields, and the values don't have to be in any specific order. The only real rule is that it has to be in the format above, and any tags I don't recognize get ignored.
Is there any good way to check to make sure a file is valid while parsing with the above constraints in mind? I'm developing in C#, version 2.0.x of .NET runtime. Thank you.