我正在尝试使用WinSCP .NET 程序集将文件夹的内容(但不是包含备份文件、存档文件和错误文件的子文件夹)的内容上传到服务器。这甚至可能吗?如果是这样,我该怎么做?
我现有作品的快速代码剪辑:
// string mode ...
// Session sess ...
// TransferOperationResult res ...
TransferOptions tOpts = new TransferOptions();
tOpts.FileMask = c.SearchPattern;
tOpts.TransferMode = TransferMode.Binary;
tOpts.PreserveTimestamp = true;
SetMessage("Uploading files");
res = sess.PutFiles(Path.Combine(c.LocalPath, c.SearchPattern),
c.RemotePath,
c.DeleteAfterXFer,
tOpts);
有没有什么办法可以说:
tOpts.TopDirectoryOnly = true
?