C#复制文件

1 string pLocalFilePath ="";//要复制的文件路径
2 string pSaveFilePath ="";//指定存储的路径
3 if (File.Exists(pLocalFilePath))//必须判断要复制的文件是否存在
4 {
5 File.Copy(pLocalFilePath, pSaveFilePath, true);//三个参数分别是源文件路径,存储路径,若存储路径有相同文件是否替换
6 }

猜你喜欢

转载自www.cnblogs.com/hahahayang/p/10292958.html