How do I echo out all the files in a folder on my server with ASP.NET?

Steven Smidley

New member
I'm switching over from PHP to ASP.NET and can't find an easy way to print all the files in a folder to the browser. In php it's as simple as:

$thumbs = opendir (thumbs);//thumbs is the directory I want to read
while (($fileOrDirectory = readdir($thumbs)) !==FALSE) //this starts the loop
{echo "<br/> $fileOrDirectory"; } //this prints the file name

Is there an easy way with ASP.NET?
 
Back
Top