#region 递归搜索目录,历遍文件
        /// <summary>
        /// 递归搜索目录,历遍文件
        /// </summary>
        /// <param name="sDir">目录名</param>
        void DirSearch(string sDir)
        {
            try
            {
                foreach (string d in Directory.GetDirectories(sDir))
                {
                    foreach (string f in Directory.GetFiles(d))
                    {
                        FileInfo fi = new FileInfo(f);
                        FileCheck(fi); //如果是文件,执行FileCheck
                    }
                    DirSearch(d); //递归查询
                }
            }
            catch (System.Exception excpt)
            {
                MessageBox.Show(excpt.Message);
            }
        }
        #endregion
posted on 2007-12-07 14:39  GFSov  阅读(3690)  评论(0编辑  收藏  举报