Cannot connect to any ftp server (wodSFTP / wodSFTP.NET / wodSFTPdll)
I recently upgraded the wodFTPDLX component to the 1.6.3 version to have .NET 2010 compatibility. However, I cannot get it to successfully connect to any ftp server since the upgrade. I receive the following exception when attempting to connect to the server from my application:
No such host is known
System.Net.Sockets.SocketException (0x80004005): No such host is known
at System.Net.Dns.GetAddrInfo(String name)
at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6)
at System.Net.Dns.GetHostEntry(String hostNameOrAddress)
I am able to connect to the specified ftp server manually. I have my code posted below. Any help will be appreciated.
public static void UploadFile(string filePath, string userName, string password, string hostName, string remotePath, string protocolType)
{
FtpDLX ftp = new FtpDLX();
ftp.Hostname = hostName;
ftp.Login = userName;
ftp.Password = password;
ftp.Blocking = true;
ftp.Timeout = 100;
switch (protocolType)
{
case s :
ftp.Protocol = Protocols.SFTP;
break;
default:
ftp.Protocol = Protocols.FTP;
break;
}
try
{
try
{
ftp.Connect();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message +
+ ex.ToString());
}
if (ftp.State == States.Connected)
{
ftp.PutFile(filePath, remotePath);
}
if (ftp.LastError != null)
{
Console.WriteLine( Error with ftp: + ftp.LastError);
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message +
+ ex.ToString());
}
finally
{
if (ftp != null)
{
ftp.Disconnect();
ftp.Dispose();
}
}
}
Complete thread:
- Cannot connect to any ftp server - Planza, 2010-11-04, 17:55
- Re: Cannot connect to any ftp server - woddrazen, 2010-11-04, 18:02
- Re: Cannot connect to any ftp server - planza, 2010-11-05, 17:27
- Re: Cannot connect to any ftp server - wodDamir, 2010-11-05, 17:39
- Re: Cannot connect to any ftp server - planza, 2010-11-05, 17:48
- Re: Cannot connect to any ftp server - wodDamir, 2010-11-05, 17:52
- Re: Cannot connect to any ftp server - planza, 2010-11-05, 18:13
- Re: Cannot connect to any ftp server - wodDamir, 2010-11-05, 17:52
- Re: Cannot connect to any ftp server - planza, 2010-11-05, 17:48
- Re: Cannot connect to any ftp server - wodDamir, 2010-11-05, 17:39
- Re: Cannot connect to any ftp server - planza, 2010-11-05, 17:27
- Re: Cannot connect to any ftp server - woddrazen, 2010-11-04, 18:02