How can I show files and their path in DataGridView without using web page? I want to display all sub folders of file I've selected with FolderBrowserDialog in one column and their path in second column. I tried to found out how it's possible, but I've found only examples in VB.net and they were using web pages for it. I want to use WinForm for display th开发者_Python百科e data.
Thanks for responses.
To get list of files and folders use the methods of System.IO.DirectoryInfo
or System.IO.Directory
class.
var result = from file in
new System.IO.DirectoryInfo(@"c:\").EnumerateFileSystemInfos()
select file;
dataGridView1.DataSource = result.ToList();
精彩评论