[C#] C# 两个目录同步的代码 →→→→→进入此内容的聊天室

来自 , 2021-03-16, 写在 C#, 查看 134 次.
URL http://www.code666.cn/view/210b7ec7
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Text;
  5. using System.Text.RegularExpressions;
  6. namespace AutoSync
  7. {
  8.     public class NewDirectory
  9.     {
  10.         public static Dictionary<string,string> GetDirectories(string dirname)
  11.         {
  12.             Dictionary<string, string> dirs = new Dictionary<string, string>();
  13.             string[] strDirs = Directory.GetDirectories(dirname);
  14.             foreach (string str in strDirs)
  15.             {
  16.                 string[] result = str.Split('\\');
  17.                 dirs.Add(result[result.Length-1], result[result.Length-1]);
  18.             }
  19.             return dirs;
  20.         }
  21.     }
  22. }
  23.  
  24.  
  25.  
  26. //csharp/5906

回复 "C# 两个目录同步的代码"

这儿你可以回复上面这条便签

captcha