FILE操作:删除与需要拷贝文件同名的文件

使用FILE.copy时,一定要删除与需要拷贝文件同名的文件,否则会报错!以前以为可以偷懒默认直接覆盖了。呵呵!

代码
1 File.Delete(@"c:\program files\wifigps\" + strfilename);
2 File.Copy(@"c:\program files\wifigps\update\" + strfilename, @"c:\program files\wifigps\" + strfilename);
3 File.Delete(@"c:\program files\wifigps\update\" + strfilename);

 

 

posted @ 2010-08-04 22:10  MobileBo  阅读(464)  评论(0编辑  收藏  举报