本文介绍了我需要使用sftp在服务器上发送文件,但它不起作用。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞!I Need To Send File On Server Using SFTP, But It Is Not Work.I have Use WinSCP And Get Error "Network error: Software caused connection abort"my code is belowpublic static int Main(){try{// Setup session optionsSessionOptions sessionOptions = new SessionOptions{Protocol = Protocol.Sftp,HostName = "",UserName = "",Password = "",GiveUpSecurityAndAcceptAnySshHostKey = true,//SshHostKeyFingerprint = "ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"};using (Session session = new Session()){// Connectsession.Open(sessionOptions);// Upload filesTransferOptions transferOptions = new TransferOptions();transferOptions.TransferMode = TransferMode.Binary;TransferOperationResult transferResult;//String filePath = Server.MapPath("Templates/3-FinancialAdvisor.pdf");transferResult = session.PutFiles(@"C:\Users\keenans", "../Bin/WinSCP.exe", false, transferOptions);// Throw on any errortransferResult.Check();// Print resultsforeach (TransferEventArgs transfer in transferResult.Transfers){Console.WriteLine("Upload of {0} succeeded", transfer.FileName);}} 我的尝试: i尝试使用所有SFTP客户端连接,但任何人都无法访问此文件而没有Filezilla。 FileZilla WinSCP WS_ftp FireFTPWhat I have tried:i have Try To It Given All SFTP Client To Connect, But Any One Not Access This Credential Without Filezilla.FileZillaWinSCPWS_ftpFireFTP推荐答案 这篇关于我需要使用sftp在服务器上发送文件,但它不起作用。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!