这是自己很久以前写的一个多线程FTP 上传工具,支持多账户,自定义线程数,自定义文件监控目录,可用做文件发布使用,非常实用,今天有小伙伴问起,现分享出来:

 

超实用文件监控多线程FTP上传工具

 

 1 using System;
 2 using System.Collections.Generic;
 3 using System.Linq;
 4 using System.IO;
 5 using System.Text;
 6 using System.Threading.Tasks;
 7 
 8 namespace NuFTPCmmndv5
 9 {
10     public class TaskFile
11     {
12         public TaskFile()
13         {
14             GUID = Guid.NewGuid();
15         }
16         private long _fileSize { get; set; }
17 
18         public Guid GUID { get; set; }
19         public string HOST { get; set; }
20         public string DIR { get; set; }
21         public string LCD { get; set; }
22         public string Priority { get; set; }
23         public string Filename { get; set; }
24         public long Size
25         {
26             get
27             {
28                 if (File.Exists(this.LCD))
29                 {
30                     _fileSize = new FileInfo(this.LCD).Length;
31                 };
32                 return _fileSize;
33             }
34             set { _fileSize = value; }
35         }
36 
37     }
38 }
View Code

相关文章: