ASP.Net FileSystem Using GridView

To access directory information, we can use either the “Directory” or the “DirectoryInfo” class; in case if we need to access file information, we have to use either the “File” class or the “FileInfo” class.

To display a directory files in a DataGrid ; we have to assign the string array to the DataSource Property and then call the DataGrid using DataBind() Method. We are using DirectoryInfo for listing directory files, however we can also display other attributes like file size etc…

View Demo

Download Source Code

One thought on “ASP.Net FileSystem Using GridView

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your 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