c# - Error 1 Non-invocable member 'System.IO.SearchOption.AllDirectories' cannot be used like a method -


string[] files = directory.getfilesystementries(directorytosearch, filenametofind, searchoption.alldirectories());

just error says, can't invoke searchoption.alldirectories method, because isn't method. think want this:

string[] files = directory.getfilesystementries(directorytosearch, filenametofind, searchoption.alldirectories); 

putting parentheses after tells compiler should execute method. confusing compiler. searchoption.alldirectories value, not method.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -

php - Accessing static methods using newly created $obj or using class Name -