0 Hi,
The GetFiles method takes a filepath as a parameter, so make sure the IIS account has the right authority to access the files and the give the local path to the files. For example:
foreach(string file in System.IO.Directory.GetFiles(@"c:\files_folder_path"))
{
// Do what you need listing the files
}
or, if the files are in the application directory of your webapplication:
(for example in the documents folder)
foreach(string file in System.IO.Directory.GetFiles(Server.MapPath("documents")))
{
// Do what you need listing the files
}