M
M
martensit2018-12-08 12:16:05
C++ / C#
martensit, 2018-12-08 12:16:05

How to get a list of all files in a directory minus "exe" files?

How to get a list of all files in a directory minus "exe" files?
string[] dirs = Directory.GetFiles(dir + @"\", ???? WHERE TO SPECIFY HERE ????);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
freeExec, 2018-12-08
@martensit

Get all the files first, and then weed out the ones you don't need.

string[] files = Directory.GetFiles(dir);
string[] notExec = files.Where(f => Path.GetExtension(f) != ".exe").ToArray();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question