怎么读取与遍历文件夹里面的所有PDF文件?
再获取文件名 ps:小弟现在是在做PDF转swf
求大神...

解决方案 »

  1.   

     string[] name = Directory.GetFiles("D:\\","*.pdf");
      

  2.   

    用Directory类。取得文件夹下所谓文件列表。然后判断是不是pdf就可以了。
      

  3.   

    DirectoryInfo dir = new DirectoryInfo(@"c:\");   
        foreach(DirectoryInfo dChild in dir.GetFiles(".pdf"))
        {//如果用GetFiles("*.pdf"),那么全部pdf文件会被显示
            Response.Write(dChild.Name + "<BR>");//打印文件名
            Response.Write(dChild.FullName + "<BR>");//打印路径和文件名
        }
    参考 http://www.cnblogs.com/myjgzs/archive/2010/10/22/1858233.html
    http://blog.sina.com.cn/s/blog_4a47f73f01009194.html