How to

get content of directory

Published: 13. December 2008 | Updated: 26. October 2011
License: Microsoft Public License (MS-PL)
Categories: File system » Directories, File system
Tags: C# Windows
Was this snippet helpful for you? YESYES / NONO
Get Analyzant!

Check your entire website from code to content in minutes with Analyzant, the free analysis suite.

Free download at analyzant.com

Get sub directories and files of specified directory

Import namespace

using System.IO;

Code

string path = @"C:\Folder\";

string[] files = Directory.GetFiles(path);
string[] directories = Directory.GetDirectories(path);
string[] filesAndDirectories = Directory.GetFileSystemEntries(path);
Send us feedback about this snippet »



Related Snippets: