C # copy or delete folders (and all subfolders and files under the folder), obtain the folder where the file is located, and read files in binary format.

Source: Internet
Author: User

The code is very simple, so you don't need to explain it. You can directly copy the code.

For more sample Code, visit microsoft sample Code (Samples from microsoft) All-In-One Code: <A href = "http://1code.codeplex.com" >http://1code.codeplex.com</A> <PRE class =brush:csharp;gutter: false ;><DIV class =cnblogs_Highlighter><PRE class =brush:csharp;gutter: false ;> using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO;   namespace ZipOneCode.FileProvider {      public class FileHelper      {          /// <summary>          /// Copy the folder (and all subfolders and files under the folder)          /// </summary>          /// <Param name = "sourcePath"> path of the folder to be copied </param>          /// <Param name = "destinationPath"> target path </param>          public static void CopyDirectory(String sourcePath, String destinationPath)          {              DirectoryInfo info = new DirectoryInfo(sourcePath);              Directory.CreateDirectory(destinationPath);              foreach (FileSystemInfo fsi in info.GetFileSystemInfos())              {                  String destName = Path.Combine(destinationPath, fsi.Name);                    if (fsi is System.IO.FileInfo)    &n

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.