System.IO.DirectoryInfo.GetDirectories C# (CSharp) Method

GetDirectories() public method

public GetDirectories ( ) : System.IO.DirectoryInfo[]
return System.IO.DirectoryInfo[]
        public DirectoryInfo[] GetDirectories()
        {
            return InternalGetDirectories("*", SearchOption.TopDirectoryOnly);
        }

Same methods

DirectoryInfo::GetDirectories ( String searchPattern ) : System.IO.DirectoryInfo[]
DirectoryInfo::GetDirectories ( String searchPattern, SearchOption searchOption ) : System.IO.DirectoryInfo[]
DirectoryInfo::GetDirectories ( ) : System.IO.DirectoryInfo[]
DirectoryInfo::GetDirectories ( string searchPattern ) : System.IO.DirectoryInfo[]
DirectoryInfo::GetDirectories ( string searchPattern, System searchOption ) : System.IO.DirectoryInfo[]

Usage Example

Esempio n. 1
1
        //Appends the any xml file/folder nodes onto the folder
        private void AddXmlNodes(FolderCompareObject folder, int numOfPaths, XmlDocument xmlDoc)
        {
            List<XMLCompareObject> xmlObjList = new List<XMLCompareObject>();
            List<string> xmlFolderList = new List<string>();

            for (int i = 0; i < numOfPaths; i++)
            {
                string path = Path.Combine(folder.GetSmartParentPath(i), folder.Name);

                if (Directory.Exists(path))
                {
                    DirectoryInfo dirInfo = new DirectoryInfo(path);
                    FileInfo[] fileList = dirInfo.GetFiles();
                    DirectoryInfo[] dirInfoList = dirInfo.GetDirectories();
                    string xmlPath = Path.Combine(path, CommonXMLConstants.MetadataPath);

                    if (!File.Exists(xmlPath))
                        continue;

                    CommonMethods.LoadXML(ref xmlDoc, xmlPath);
                    xmlObjList = GetAllFilesInXML(xmlDoc);
                    xmlFolderList = GetAllFoldersInXML(xmlDoc);
                    RemoveSimilarFiles(xmlObjList, fileList);
                    RemoveSimilarFolders(xmlFolderList, dirInfoList);
                }

                AddFileToChild(xmlObjList, folder, i, numOfPaths);
                AddFolderToChild(xmlFolderList, folder, i, numOfPaths);
                xmlObjList.Clear();
                xmlFolderList.Clear();
            }
        }
All Usage Examples Of System.IO.DirectoryInfo::GetDirectories