I wrote an application that search for a specific text in flat files. But the problem that i'm having is that my application end up reading non flat files like doc,docx etc. So i want to prevent this from happening. Is there a logic that i can use to determine if a file is flat file or not ?
By flat files i'm referring to files such as .log, .txt, .config, .cs, .vb etc.
Here is my code to read files :
string[] extension = txtExtension.Text.Split(';');
if (extension.Length == 1)
{
string[] files = Directory.GetFiles(txtDirectory.Text, "*." + txtExtension.Text.Trim(), SearchOption.AllDirectories);
for (int append = 0; append < files.Length; append++)
{
}
}