winforms - c# Cannot get list of subdirectories -
i've seen code (and similar) on web, cannot work. whenever debug line line, breaks out of debugging , loads application. no error messages presented, , code after "faulty" line remains unprocessed.
here offending code:
foreach (string folder in allfolders) { string[] subfolders = directory.getdirectories(folder, "*", searchoption.alldirectories); messagebox.show("test"); }
the foreach loop entered into, message box never displayed.
if remove searchoption.alldirectories
code processed successfully, need way include all subdirectories within directories.
any ideas?
your code works fine me.
seems me method call takes lot of time execute. example, if there root directory in allfolders have wait several minutes (depends on system parameters). have checked code snippet on directories few number of nested directories?
assumed, work in winforms , execution doesn't reach messagebox.show call.
Comments
Post a Comment