C# 循环遍历目录、子目录

内容纲要

        // 遍历
        public void Traverse(string dirpath)
        {
            string[] dirs = Directory.GetDirectories(dirpath);

            if (dirs.Length != 0)
            {
                foreach (var item in dirs)
                {
                    Traverse(item);
                }
            }
            // 其他要执行的代码

        }
点赞
  1. cheap remeron说道:

    My husband and i ended up being quite joyful that John managed to do his preliminary research through the entire precious recommendations he grabbed out of your web pages. It is now and again perplexing to just continually be giving out procedures which others may have been selling. So we grasp we have got the writer to give thanks to for that. The main illustrations you have made, the simple web site navigation, the relationships you will help foster - it's got many incredible, and it's really helping our son in addition to the family know that the matter is excellent, which is quite mandatory. Thank you for everything!

  2. I am only writing to make you understand what a really good experience my wife's princess obtained viewing your webblog. She noticed some things, which included what it is like to possess an ideal teaching spirit to make others without difficulty learn about specific tortuous things. You undoubtedly surpassed readers' expected results. Thanks for rendering those productive, trusted, informative as well as unique tips on your topic to Mary.

发表评论

邮箱地址不会被公开。 必填项已用*标注

You must enable javascript to see captcha here!