Proxy 如何使用FTPWebRequest通过代理导航到子目录

Proxy 如何使用FTPWebRequest通过代理导航到子目录,proxy,ftp,ftpwebrequest,Proxy,Ftp,Ftpwebrequest,我目前正试图通过ftp代理登录到ftp服务器。使用以下代码段 async { let r = FtpWebRequest.Create("ftp://<ftp-proxy-address>") :?> FtpWebRequest r.Method <- WebRequestMethods.Ftp.ListDirectoryDetails r.Timeout <- req.Timeout.Tot

我目前正试图通过ftp代理登录到ftp服务器。使用以下代码段

 async {
          let r = FtpWebRequest.Create("ftp://<ftp-proxy-address>") :?> FtpWebRequest
          r.Method <- WebRequestMethods.Ftp.ListDirectoryDetails      
          r.Timeout <- req.Timeout.TotalMilliseconds |> int
          r.Proxy <- null 
          r.Credentials <- NetworkCredential("user@host/subdirectory","password")
          use! response = r.AsyncGetResponse()
          use sr = new StreamReader(response.GetResponseStream(), req.Encoding)
          let result = handler sr
          return result
        }
async{
让r=FtpWebRequest.Create(“ftp:/”):?>FtpWebRequest

r、 方法您必须先登录,然后更改目录。

遗憾的是,这不起作用。无法通过FtpWebRequest发出CWD/CD命令。这对您来说是透明的,但似乎不适用于代理