码迷,mamicode.com
首页 > Windows程序 > 详细

c# 文件另存为代码

时间:2016-11-02 00:06:07      阅读:328      评论:0      收藏:0      [点我收藏+]

标签:net   source   利用   file   target   复制   命名空间   write   目标   

利用.NET中的File.Copy方法

命名空间:System.IO

重载列表:Copy(string sourceFilePath,string targetFilePath)

     sourceFilePath:要复制的文件路径。

     targetFilePath:目标文件的路径,不能是目录和现有的文件

     如果目标文件已经存在,会产生IOException

      

     Copy(string sourceFilePath,string targetFilePath,bool overwrite)

     sourceFilePath:要复制的文件路径。

     targetFilePath:目标文件的路径,不能是目录

     overwrite :true表示可以覆盖目标文件,false表示不能覆盖目标文件

     

c# 文件另存为代码

标签:net   source   利用   file   target   复制   命名空间   write   目标   

原文地址:http://www.cnblogs.com/MaFeng0213/p/6021038.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!