c# - How do i get all files from directory including sub directories? -


this question has answer here:

this code:

private void searchfordoc()         {             t = environment.getenvironmentvariable("userprofile")+"\\documents";             string[] s = directory.getfiles(t, "*.txt",); 

this search txt files in directory want find text files in subdirectories. there should searchoption searchoption after "*.txt",

use overload: directory.getfiles method (string, string, searchoption), searchoption searchoption.alldirectories.

string[] s = directory.getfiles(t, "*.txt", searchoption.alldirectories); 

Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -