Connecting Tech Pros Worldwide Forums | Help | Site Map

Get List of File Names from specified Directory

Newbie
 
Join Date: Nov 2006
Posts: 2
#1: Nov 3 '06
HelowWw fellow programmers :)

I have a web application that opens a pdf file. Very simple indeed. However the file name is not known. The file has to be found by first searching the list of all files present in a particular directory. All i want to know is how do i get a list of the file names in that directory.

Lets say the directory is LBS and this directory contains a number of pdf files. All i want to do is get their names.

Also is there anyway to find out the content of that pdf from within the c# program. The aim is to open a PDF file matching a specific date (the easy way is to rename the pdfs and include the dates which is why i need to get the list of all file names) other way is to open every pdf up and search for the date, if it matches then save that name.

Any help in this regard would be greatly appreciated.

Thank you for your time and support.
Regards

Zeeshan

Needs Regular Fix
 
Join Date: Jul 2006
Location: India,Hyderabad
Posts: 367
#2: Nov 6 '06

re: Get List of File Names from specified Directory


hello

if you want to open a particular directory in button click then use filedialod control in c#.net then it will open the default directory what you choosed then you can selet the fie what you need.






regards

nmsreddi
Newbie
 
Join Date: Nov 2006
Posts: 2
#3: Nov 9 '06

re: Get List of File Names from specified Directory


Thanks :)
But i have found a way

string fileName = Path.GetFileNameWithoutExtension(mainPath + flist[i]);

put this is a loop and thts it :)
Reply


Similar .NET Framework bytes