2013-08-12 53 views
0

我有一個代碼中使用通過SFTP上傳文件「SharpSSH - 安全外殼(SSH)庫的.NET」塔米爾的加爾。上傳文件拋出Tamir.SharpSsh.jsch.SftpException

它工作正常,但在某些情況下,我會拋出「Tamir.SharpSsh.jsch.SftpException」異常。 任何線索可能是什麼?

+0

問題解決了,沒有權限寫入該FTP文件夾。我已經嘗試過使用fileZilla並設法訪問該文件夾,但是當我嘗試放置文件時出現錯誤 –

回答

0

問題解決了,沒有寫入到該FTP文件夾的權限。我曾嘗試使用fileZilla並設法訪問該文件夾,但是當我嘗試放置文件時出現錯誤。

錯誤沒有提及是什麼原因 - 最好嘗試用另一個像FileZila這樣的收費來檢查它。

-1
//Esto funcionara al momento de hacer el Get tenemos que especificar el  //directorio principal del FTP+nombre del archivo 

    private static bool descargar_archivos() 
     { 
      Sftp _sftp = new Sftp(Servidor_FTP, Usuario_FTP, Contrasena_FTP); 

      _sftp.Connect(Puerto); 

      var lista = _sftp.GetFileList(Directorio_inicio_FTP); 

      foreach (string dir in lista) 
      { 
       if (dir.Length > 4) 
       { 
       _sftp.Get(Directorio_inicio_FTP+dir, Directorio_Destino + dir); 

       } 
      } 
      _sftp.Close(); 

      return true; 
     } 
+0

您添加的代碼很好,但按照每個問題解釋它將如何提供幫助。 – Ajay2707

相關問題