Click here to Skip to main content
15,891,423 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I want to get all .mdb files name from a folder in c#.

suppose a folder name is abc which is having 10 files of .mdb like

test1.mdb
test2.mdb
test3.mdb
..
.
.
.
test10.mdb

and i want that all .mdb file name in c# .


in a array or listbox or combobox

Please help
Posted
Updated 5-May-14 18:54pm
v2

Hi,

Here is the solution.

C#
string[] filePaths = Directory.GetFiles(@"c:\Maps\", "*.mdb",
                                         SearchOption.TopDirectoryOnly);
 
Share this answer
 
Comments
Meysam Toluie 6-May-14 1:32am    
+5!
Try this:
C#
string[] array = Directory.GetFiles("Source path", "*.mdb");
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900