Login  Register 
Home
 
Applications
 
Consulting
 
Design
 
Business Links
 
Support
 
Contact
  Search
Search
 
 SupportKnowledge BaseC Sharp - C#     May 17, 2012  
Snippets
29

List files in a folder . . .

    private void ListFiles()
    {

        DirectoryInfo di = new DirectoryInfo("C:/VirtualDomains/www.xxx.com/htdocs/PDF");
        FileInfo[] rgFiles = di.GetFiles("*.PDF");
        foreach (FileInfo fi in rgFiles)
        {
            FileList += ("<br><a href=/PDF/" + fi.Name + ">" + fi.Name + "</a>");
        }

        lblFiles.Text = FileList.ToString();
    }

Posted in: C Sharp - C#

Post Rating

Comments

There are currently no comments, be the first to post one.

Post Comment

Only registered users may post comments.
 

P.O. BOX 2342 ~ BREWSTER, MA 02631
PHONE & FAX: (508) 714-0678

 
 Copyright 2012 by Global Internet Business Solutions   Terms Of Use  Privacy Statement