read all file names exists in perticular directory

(In order to Enlarge images Please Right Click and Open images in New Tab).

 

2

 

Let’s see how to read all file names exists in perticular directory

 

dd1.png

 

string downloadpath = @”C:\\1″;
DirectoryInfo dir = new DirectoryInfo(downloadpath);
var files = dir.GetFiles(“*.*”);
foreach (var file in files)
{
FilesInfo obj = new FilesInfo();
obj.FileName = file.Name;
lstFileinfo.Add(obj);
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s