오른쪽 클릭 메뉴를 사용하여 수동으로 파일을 삭제하면 파일이 삭제됩니다.모든 폴더에서 모든 파일 삭제
그러나 나는이 코드를 실행하면
그래서 어떻게해야합니까 :"A first chance exception of type 'System.UnauthorizedAccessException' occurred in mscorlib.dll Access to the path 'c:\My cloud\VM Instances\i-7e3cbb19 (manish).cvm' is denied. The thread '' (0xb5c) has exited with code 0 (0x0). A first chance exception of type 'System.UnauthorizedAccessException' occurred in mscorlib.dll 'cloud_sync.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled."
string[] filePaths = Directory.GetFiles(@"c:\My cloud\VM Instances\");
foreach (string filePath in filePaths)
File.Delete(filePath);
내가이 오류를 가지고 있습니까?
너무 빨리 답장 해 주셔서 감사합니다. 이것은 창 서비스입니다. 그렇다면 어떻게 모든 권한을 가진 코드를 실행할 수 있습니까? – manish
너무 빨리 답장 해 주셔서 감사합니다. 이것은 창 서비스입니다. 그렇다면 어떻게 모든 권한을 가진 코드를 실행할 수 있습니까? – manish
@manish, 별도의 질문을하거나, 검색 엔진 (예 : http://www.bing.com/search?q=windows+service+account+permissions)에서 "Windows 서비스 계정 권한"을 검색하는 것이 좋습니다. –