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
Post a Comment