特点:
1. 最低依赖.net 2.0
2. 数据类型可选二进制流或者Base64字符串
3. 灵活设置分块大小
4. 实现简单,入手改造成本低
5. 使用简单.
使用示例
1. 下载FileSectionUpload.dll 或者使用源码编译后生成dll 引入项目。
2. 使用说明
//上传实例
SectionSetting setting = new SectionSetting();
setting.FileFullName = @"C:\Segments\python-3.7.0-amd64.exe";
setting.SectionSize = SectionSize._512KB;
FileSectionUp upInstance = new FileSectionUp(setting);
for (int i = 0; i < upInstance.TotalSectionCount; i++)
{
var section = upInstance.GetFileData(i);
....... 通过json,xml 等方式将section 发送到服务器端
}
------------------------------------------------------------------------------
//接收保存实例
FileSectionSave saveInstance = new FileSectionSave(@"C:\Segments\","a.exe");
......... 通过网络反序列化接收到 section
var result = saveInstance.SaveSection(section);
if (!result.Success)
{
Console.WriteLine("失败:" + result.Message);
}
if (result.FileFinished)
{
Console.WriteLine("全部上传完毕");
}
3. 源码下载: https://github.com/SaFaJim/FileSectionUpload
4. dll 下载 https://download.csdn.net/download/Asa_Jim/13035349