FluentFTP - Getting error while connecting “Timed out trying to read data from the socket stream!”

后端 未结 2 1044
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-13 09:43

Getting

Timed out trying to read data from the socket stream!

when connecting to FTP using FluentFTP.

Below is the sourc

2条回答
  •  春和景丽
    2021-01-13 10:02

    The following code is all you need to get FluentFtp (at least nuget (1.0.5824.34026) to use secure connection .

            FtpClient fclient = new FtpClient(hostname, username, password); // or set Host & Credentials
    
            fclient.EncryptionMode = FtpEncryptionMode.Implicit;  
            fclient.SslProtocols = SslProtocols.Tls12;
    
            //client.Port = 990;  // Not required - probably gives you exceptions if you try to set it. 
    
            fclient.Connect();
            fclient.UploadFile(@"C:\tmp\a.txt", "big.txt");
    

提交回复
热议问题