Saturday, January 8, 2011

Display file information in GridView


Display file information in GridView







You can get assign fileinfo object to datasource property to gridview which display all the information of file in gridview.



Code Snippet:





       DirectoryInfo dir = new DirectoryInfo("C:\\WINDOWS\\");

       FileInfo[] fi = dir.GetFiles();

        GridView1.DataSource = fi;

        GridView1.DataBind();

No comments:

Post a Comment