[C#]파일 존재 여부 및 파일 정보
System.IO 참조
_strFile = "C:\\test.txt"; //파일경로
FileInfo _finfo = new FileInfo(_strFile);
파일 있는지 확인 _finfo.Exists
_strFile = "C:\\test.txt"; //파일경로
FileInfo _finfo = new FileInfo(_strFile);
파일 있는지 확인 _finfo.Exists
있을때 true 없으면 당근 false
**폴더 일경우는 FileInfo 대신에 DirectoryInfo 사용한다.
댓글
댓글 쓰기