• Login

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

Name (required)

Email (required)

Website