파일 속성에 보관 속성 혹은 읽기 전용 속성이 켜져있는 경우, 해당 오류가 난다면 다음의 방법이 통할 수 있습니다.
--------------------------------------------------------------------------------------------------------------
The problem can be that you can not delete or overwrite read-only files. The solution is to change the attributes.
if(File.Exists(destFile))
{
File.SetAttributes(destFile, FileAttributes.Normal);
}
File.Copy(sourcePath, destFile, true);
----------------------------------------------------------------------------------------------------------------
'TroubleShooting' 카테고리의 다른 글
데이터베이스 '[DB명]'은(는) 해당 버전이 706이므로 열 수 없습니다. (0) | 2018.05.14 |
---|---|
SQLite keeps the database locked even after the connection is closed (0) | 2018.05.06 |
[UWP] Finding Control inside ListView (0) | 2018.04.29 |
방법: 편집하며 계속하기 사용(C#) (0) | 2018.04.29 |
Visual Studio에서 원격 컴퓨터 UWP 앱 실행 (0) | 2018.04.29 |