Live Chat Icon For mobile
Live Chat Icon

I want to iterate through both files and folders in a given folder. Is this possible

Platform: WinForms| Category: General IO

Yes



string[] contents = Directory.GetFileSystemEntries('folderName');
			foreach(string s in contents)
				Console.WriteLine(s);

Share with

Share on twitter
Share on facebook
Share on linkedin

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.