Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

C# C# Streams and Data Processing Reading Data Working with Files

working with files question 3

fill in the blank to find all files in the directory that have a .png file extension var files=directory.GetFiles("_");

2 Answers

Björn Böning
Björn Böning
10,332 Points

The answer is: *.png

* means "all" when working with file systems and is mostly independent to the operating system. So this is the same for Linux, Unix, DOS, Windows, you name it.

*.* i.e. means basically all files in the given directory. It's also used as some kind of completion help. For example you're looking for a document, and you only know it's a .txt file that has the word "operations" in the name. You could type this into the console: ls *operations*.txt

This would list all files, that has the word operations somewhere in the filename and has the extension .txt

If you're missing knowledge in the console area, I highly recommend to have a look into this course: https://teamtreehouse.com/library/console-foundations

thank you