【发布时间】:2013-09-24 13:39:33
【问题描述】:
当我尝试将文件从一个位置复制到另一个位置时,仅当文件已存在于目标位置时,我收到错误消息。尽管将覆盖标志设置为 true,但仍会发生这种情况。
我没有得到任何线索。 这是代码。
System.IO.File.Copy(source, destination, true);// goes fine as the destination file is not present
System.IO.File.Copy(source, destination, true);// Throws the exception
//"Access to the path 'C:\\Program Files (x86)\\testapp\\map\\sometext.txt' is denied."
请指导。
谢谢 苏尼尔
【问题讨论】:
-
这是 Windows 7 UAC 导致的问题 stackoverflow.com/questions/6412896/…
标签: c# .net system.io.fileinfo