Answers for "c# retrieve files in folder"

C#
1

c# retrieve files in folder

using System.IO;

string[] filePaths = Directory.GetFiles(@"c:\MyDir\");
// returns:
// "c:\MyDir\my-car.BMP"
// "c:\MyDir\my-house.jpg"
Posted by: Guest on June-16-2020
1

c# retrieve files in folder

string[] filePaths = Directory.GetFiles(@"c:\MyDir\", "*.bmp");
// returns:
// "c:\MyDir\my-car.BMP"
Posted by: Guest on June-16-2020
1

c# retrieve files in folder

string[] filePaths = Directory.GetFiles(@"c:\MyDir\", "*.bmp",
                                         SearchOption.AllDirectories);
// returns:
// "c:\MyDir\my-car.BMP"
// "c:\MyDir\Friends\james.BMP"
Posted by: Guest on June-16-2020

C# Answers by Framework

Browse Popular Code Answers by Language