Simple implementation method of copying files in C#

高洛峰
Release: 2017-01-19 13:27:43
Original
1597 people have browsed it

The example in this article describes the simple implementation method of copying files in C#. Share it with everyone for your reference. The specific analysis is as follows:

To copy a file in C#, you can first specify the file through FileInfo, and then copy the file to the specified location through the CopyTo method of FileInfo

FileInfo fi = new FileInfo(@"C:\file.txt");
if(fi.Exists)
{
  fi.CopyTo(@"C:\copyfile.txt");
}
Copy after login

Hope this article explains It will be helpful for everyone's C# programming.

For more articles related to the simple implementation method of copying files in C#, please pay attention to the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!