DirectoryInfo's GetFileInfo Search pattern question

M

Mullin Yu

e.g. c:\test

doc1.txt
doc1.pdf
doc2.txt
doc2.pdf
doc3.txt
doc4.pdf
doc5.txt
doc5.pdf

only doc1, doc and doc5 will be returned as has both .txt and .pdf files

how to implement? i'm not sure whether the DirectoryInfo's GetFileInfo's
seach pattern can do so or not?
 
H

Herfried K. Wagner [MVP]

Mullin Yu said:
e.g. c:\test

doc1.txt
doc1.pdf
doc2.txt
doc2.pdf
doc3.txt
doc4.pdf
doc5.txt
doc5.pdf

only doc1, doc and doc5 will be returned as has both .txt and .pdf files

how to implement? i'm not sure whether the DirectoryInfo's GetFileInfo's
seach pattern can do so or not?

You'll have to call the method multiple times, each time with one of the
file patterns. Make sure that the result of the patterns is distinct so you
don't get the same file more than one time.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top