반응형
C# Examples (csharp-examples.net)
Delete All Files (*.*)
//Delete all files
using System.IO;
string[] filePaths = Directory.GetFiles(@"c:\MyDir\");
foreach (string filePath in filePaths)
File.Delete(filePath);
//Delete all files (one-row example)
Array.ForEach(Directory.GetFiles(@"c:\MyDir\"),
delegate(string path) { File.Delete(path); });
반응형
'Programming > C#' 카테고리의 다른 글
OOP 설계의 기본 원칙 SOLID (0) | 2019.09.15 |
---|---|
테스트 자동화 (0) | 2019.09.13 |
닷넷에서 오라클에 접근하는 7가지 방법 (0) | 2017.12.08 |
세션의 SET 옵션 확인하기 (0) | 2017.12.08 |
LinqToDataSet Helper (0) | 2017.09.29 |