【发布时间】:2013-04-23 12:21:58
【问题描述】:
我需要在文件下载(也上传)之前启用 LocalWorking 目录的切换,以允许将文件下载到与本地当前工作目录不同的目录。此外,允许从目录上传,而不是当前本地工作目录。由于 Xceed FTPClient 对象没有公开本地目录属性或过程,只允许我指定要切换到的子文件夹或路径,因此我尝试使用 IssueCommand 例程,就像这样,
ftpClient.IssueCommand(String.Format(" cwd {0}, localworkingpath));
相反,该命令是针对远程计算机而不是我的本地计算机执行的。
Assert.IsTrue 失败。文件传输不成功。详细信息:Xceed.Ftp.FtpReplyException:C:\MultiDownloads\LocalDirectorySwitch:文件名、目录名或卷标语法不正确。 (回复代码550) 在 Xceed.Ftp.Engine.FtpCommand.EndExecute(IAsyncResult asyncResult) 在 Xceed.Ftp.FtpClient.SendCustomCommand(字符串命令)
当我使用命令时
ftpClient.IssueCommand(String.Format(" lcd {0}, localworkingpath));
我收到以下错误消息
Assert.IsTrue 失败。文件传输不成功。详细信息:Xceed.Ftp.FtpReplyException:'LCD C:\MultiDownloads\LocalDirectorySwitch':命令不理解(回复代码 500) 在 Xceed.Ftp.Engine.FtpCommand.EndExecute(IAsyncResult asyncResult) 在 Xceed.Ftp.FtpClient.SendCustomCommand(字符串命令)
请问如何更改我的 ftpClient 对象的本地工作目录?提前致谢。
【问题讨论】: