C# File.Copy介绍

简介: C# File.Copy介绍

判断文件是否存在:

               if (File.Exists(@"E:\exists.txt"))
 4             {
 5                 MessageBox.Show("文件存在");
 6             }
 7             else
 8             {
 9                 MessageBox.Show("无此文件");
10             }

拷贝文件:

File.Copy(path1,path2,true);        path1表示你要复制文件的路径    


                                                       path2 表示你要复制后文件的路径


                                                       true :表示如果有相同的文件就是指覆盖。

相关文章
|
6天前
|
编译器 API C语言
C/C++ 获取文件名的方法:分享一些实用的获取文件名的方法和技巧(__FILE__,__builtin_FILE(),__BASE_FILE__等)
C/C++ 获取文件名的方法:分享一些实用的获取文件名的方法和技巧(__FILE__,__builtin_FILE(),__BASE_FILE__等)
87 0
|
6天前
|
Java
cannot open shared object file: No such file or directory
cannot open shared object file: No such file or directory
25 0
|
6天前
|
算法 C++ 容器
【C++11算法】find_if_not、 copy_if、copy_n
【C++11算法】find_if_not、 copy_if、copy_n
|
6月前
指定的 filePath 文件不存在
指定的 filePath 文件不存在
23 2
FILE
FILE
91 0
Can‘t read file : End of file found 文件:txn_current、current svn无法正常读取文件
Can‘t read file : End of file found 文件:txn_current、current svn无法正常读取文件
Can‘t read file : End of file found 文件:txn_current、current svn无法正常读取文件
|
Python
6.2 file 写文件
#!/usr/bin/env python # -*- coding:utf-8 -*- #@Time      :2017/10/27 22:15 #@Author    :zhouyuyao #@File      :file_write.
667 0