List<string> directorys = new List<string>();
List<string> filesinfo = new List<string>();
private  void  getlist(string path)
{
       DirectoryInfo directory = new DirectoryInfo(path);
       FileSystemInfo[] filesArray = directory.GetFileSystemInfos();
       foreach (var item in filesArray)
       {
            if (item.Attributes == FileAttributes.Directory)
            {
                 directorys.Add(item.FullName);
                 getlist(item.FullName);
            }
            else
            {
                 filesinfo.Add(item.FullName);
            }
       }
}
posted on 2012-12-20 10:34  自由的鹰  阅读(955)  评论(0编辑  收藏  举报