How can i get ALL File Extentions in C#? [closed]

A file can have whatever extension it wants. It can be any sequence of characters of any length. Since that sequence is infinite, there is no way to put them all in a list.

If you want to know if the directory you’re interested in has any files with a given extension, you can enumerate all of the files in the directory and put all of their extensions into a set.

Leave a Comment