반응형
public static string[] FileSearch(string strDir, string strMatch, bool bSubDir)
{
if (Directory.Exists(strDir) == false || strMatch.Length <= 0)
return null;
using (FindFiles.FileSystemEnumerator fse = new FindFiles.FileSystemEnumerator(strDir, strMatch, bSubDir))
{
IEnumerator<FileInfo> ien = fse.Matches().GetEnumerator();
ien.Dispose();
int nSearched = 0;
int index = 0;
string[] strResult = null;
foreach (FileInfo fi in fse.Matches())
{
nSearched++;
}
if (nSearched > 0)
{
strResult = new string[nSearched];
foreach (FileInfo fi in fse.Matches())
{
strResult[index++] = fi.FullName;
}
}
return strResult;
}
}
반응형
'[====== Development ======] > C#' 카테고리의 다른 글
Email 전송 기능 (0) | 2021.02.05 |
---|---|
DateTime Extention Method (0) | 2021.02.05 |
dll 파일의 32bit용 / 64bit 인지 여부 확인하는 함수 (0) | 2021.02.05 |
WPF(XAML) - Animation (0) | 2021.01.21 |
WPF(XAML) - Triggers (0) | 2021.01.21 |