I need to download some files from SFTP location.
I am using SharpSsh libraries, but I cannot connect.
Below are my SFTP details:
<add key="FTPHost" value="xyz.csod.com" /> <add key="FTPDirectory" value="/Test" /> <add key="FTPUserName" value="abc" /> <add key="FTPPassword" value="pass" /> <add key="FTPPort" value="22" />
And below is the C # code snippet for connecting to SFTP:
using Tamir.SharpSsh; using Tamir.SharpSsh.jsch; using Tamir.Streams; public string DownloadFile() { Sftp oSftp = new Sftp(host, userName, password);
But I get an exception in Connect (). Is -
Additional Information:
System.Net.Sockets.SocketException (0x80004005): the requested name is valid, but the data of the requested type was not found
System.Net.Dns.InternalGetHostByName (String hostName, Boolean includeIPv6) in System.Net.Dns.GetHostByName (String hostName) on Tamir.SharpSsh.java.net.Socket..ctor (host String, Int32 port) on Tamir.SharpSsh .jsch.Util.createSocket (host String, Int32 port, Int32 timeout) "
I am working with a C # console application.
source share