ProclaimDragon Posted September 12, 2004 Share Posted September 12, 2004 I'm loading all the text files on a specific directory and for that I have: Dim notesFiles As FileInfo() = dirInfo.GetFiles("*.txt") However, FileInfo array will have files that termiante in .txt and .txt???? Where the questions marks can be any letter and can be just one letter or more... I want it to scan exactly only text files .txt, how can I do that? Link to comment Share on other sites More sharing options...
0 azcodemonkey Posted September 12, 2004 Share Posted September 12, 2004 You can't according to the docs: The matching behavior of searchPattern when the extension is exactly three characters long is different from when the extension is more than three characters long. A searchPattern of exactly three characters returns files having an extension of three or more characters. A searchPattern of one, two, or more than three characters returns only files having extensions of exactly that length. The following list shows the behavior of different lengths for the searchPattern parameter: "*.abc" returns files having an extension of .abc, .abcd, .abcde, .abcdef, and so on. "*.abcd" returns only files having an extension of .abcd. "*.abcde" returns only files having an extension of .abcde. "*.abcdef" returns only files having an extension of .abcdef. Link to comment Share on other sites More sharing options...
0 ProclaimDragon Posted September 12, 2004 Author Share Posted September 12, 2004 hum... ok, I'll code a workaround then...thanks Link to comment Share on other sites More sharing options...
Question
ProclaimDragon
I'm loading all the text files on a specific directory and for that I have: Dim notesFiles As FileInfo() = dirInfo.GetFiles("*.txt")
However, FileInfo array will have files that termiante in .txt and .txt????
Where the questions marks can be any letter and can be just one letter or more... I want it to scan exactly only text files .txt, how can I do that?
Link to comment
Share on other sites
2 answers to this question
Recommended Posts