[C#][IO][Threading][Example] Local data aggregation operation before work report

[C#][IO][Threading][Example] Local data aggregation operation before work report The data acquisition operation before the report is highly repetitive. The script is almost completed today. The following is the code: 1 // See https://aka.ms/new-console-template for more information 2 using System.IO; 3 using span> System.Threading; 4 5 string SN = @”C0230U25″; 6 string span> sourcefold = @”F: \Full picture”; 7 string span> flasefold = @”F: \Error”; 8 string span> rootPath = @””; 9 Report r = new(rootPath); 10 string span>[] foldlist = r.CreateFlaseFold(sourcefold, flasefold); 11 //Console.WriteLine(r.FindSN(sourcefold, SN)); 12 ThreadInvote tp = new ThreadInvote(action, r, foldlist); 13 14 static void action(Report r, string[] str, int num) 15 { 16 r.CopyLimitFold (str, num); 17 } 18 19 static void FindFalsePic() 20 { 21 foreach span> (var fold in span> Directory.GetDirectories(@” F:\Error\1011″)) 22 { 23 foreach span> (var file in span> Directory.GetFiles(fold, “*.jpg”)) 24 //Console.WriteLine(file[(fold.Length+1)..]); 25 File.Copy(file, Path.Combine(@”F:\Error\1011 Overkill”, file[(fold.Length + 1)..])); 26 } 27 } 28 29 //Thread t_0 = new Thread(() => r.CopyLimitFold(foldlist, 0)); 30 //Thread t_1 = new Thread(() => r.CopyLimitFold(foldlist, 1)); 31 //t_0.Start(); 32 //t_1.Start(); 33 //t_0.Join(); 34 //t_1.Join(); 35 36 37 # region report data capture class 38 class span> Report 39 { 40 int span> count = 0; 41…

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索