V3.33新增的文件夹远程上传/下载功能很简单、好用,举例://// 上传文件夹...procedure TForm1.Button2Click(Sender: TObject);
begin
if RpcRemoteFiles1.UploadFolder(qbconnection1.NodeId,edit1.text,edit2.text,5,0) then
memo1.lines.add('上传文件夹成功!UploadOkIndex='+inttostr(RpcRemoteFiles1.UploadOkIndex)) else
memo1.lines.add('上传文件夹失败!UploadOkIndex='+inttostr(RpcRemoteFiles1.UploadOkIndex));
end;
//// 上传文件夹续传测试...procedure TForm1.Button1Click(Sender: TObject);
begin
if RpcRemoteFiles1.UploadFolder(qbconnection1.NodeId,edit1.text,edit2.text,5,100) then
memo1.lines.add('上传文件夹(续传)成功!') else
memo1.lines.add('上传文件夹(续传)失败!');
end;
//// 下载文件夹...procedure TForm1.Button3Click(Sender: TObject);
begin
if RpcRemoteFiles1.DownloadFolder(qbconnection1.NodeId,edit2.text,edit1.text,5,0) then
memo1.lines.add('下载文件夹成功!DownloadOkIndex='+inttostr(RpcRemoteFiles1.DownloadOkIndex)) else
memo1.lines.add('下载文件夹失败!DownloadOkIndex='+inttostr(RpcRemoteFiles1.DownloadOkIndex));
end;
//// 下载文件夹续传测试...procedure TForm1.Button5Click(Sender: TObject);
begin
if RpcRemoteFiles1.DownloadFolder(qbconnection1.NodeId,edit2.text,edit1.text,5,100) then
memo1.lines.add('下载文件夹(续传)成功!') else
memo1.lines.add('下载文件夹(续传)失败!');
end;
//// 总下载进度...procedure TForm1.RpcRemoteFiles1AllDownloadProgress(Sender: TObject;
AllObjects, OkObjects: Integer);
begin
ProgressBar1.Max:=AllObjects;
ProgressBar1.Position:=OkObjects;
edit3.text:=inttostr(AllObjects);
edit4.text:=inttostr(OkObjects);
end;
//// 总上传进度...procedure TForm1.RpcRemoteFiles1AllUploadProgress(Sender: TObject;
AllObjects, OkObjects: Integer);
begin
ProgressBar1.Max:=AllObjects;
ProgressBar1.Position:=OkObjects;
edit3.text:=inttostr(AllObjects);
edit4.text:=inttostr(OkObjects);
end;
//// 文件下载进度...procedure TForm1.SyncBurro1FileReadProgress(Sender: TObject;
AllBlocks, CurrentBlock: Integer);
begin
ProgressBar2.Max:=AllBlocks;
ProgressBar2.Position:=CurrentBlock;
end;
//// 文件上传进度...procedure TForm1.SyncBurro1FileWriteProgress(Sender: TObject;
AllBlocks, CurrentBlock: Integer);
begin
ProgressBar2.Max:=AllBlocks;
ProgressBar2.Position:=CurrentBlock;
end;