Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

How can i Get Files from nth sub-directory of an input Directory using C#.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.0k views
Welcome To Ask or Share your Answers For Others

1 Answer

here is the solution i have done . and its working .

foreach(var dir in Input_Folders)
        {
            string f = dir;

            for (int i = 0; i <= n; i++)
            {

                string path = sub_dir(f);
                f = path;
            }
} 

n is the nth child and the method sub_dir(string) is

public string sub_dir(string path)
        {

            string[] direct = Directory.GetDirectories(path);
            string s = direct[0];
            return s;
        }

this will go to the nth child of the each input directory .. check this out .


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...