C#.net / WPF
경로의 특정 확장자 파일만 모두 삭제
ahnshy
2024. 3. 13. 07:40
반응형
SMALL
public void DeleteAllExtFiles(string targetPath, string ext)
{
if (!System.IO.Directory.Exists(targetPath))
return;
{
// string targetPath = @"C:\Users\AppData\Local\Temp";
// string ext = "*.temp";
}
string[] files = Directory.GetFiles(sourceDir, ext);
foreach (var file in files)
File.Delete(file);
}
반응형
LIST