Reputation: 11
I'm trying to connect to SFTP server using SharpSSH, and getting exception -
Tamir.SharpSsh.jsch.JSchException: System.Net.Sockets.SocketException: The requested name is valid, but no data of the requested type was found
My code looks like this:
Sftp sftp = null;
sftp = new Sftp("ftp://XX.XXX.XX.XX/", "UserName", "Password");
sftp.Connect();
Am I writing server address in wrong format?
What can be the other reason? If DNS issues.. then what are those and how to resolve them?
Upvotes: 1
Views: 846
Reputation: 202504
Sftp
class is called sftpHost
, so you cannot pass a URL, you have to pass a host name, i.e. only the XX.XXX.XX.XX
.FtpWebRequest
from the .NET framework.Upvotes: 1