C#.net如何显示一个目录下的所有文件含文件夹?

解决方案 »

  1.   

    System.IO.DirectoryInfo di=new DirectoryInfo (@"c:\");
    foreach(FileSystemInfo f in di.GetFileSystemInfos ())
    {
    Response.Write (f.Name+"<br>");
    }
      

  2.   

    你可以生成一个数组存放,然后绑定到datagrid这些控件上
      

  3.   

    using System.IO;DirectoryInfo di = new DirectoryInfo (@"c:\");
    这样就可以了,自己查查.netframework的类库参考,里面有详细解释及用法
      

  4.   

    sorry,点击后不能连接该文件...