Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
in .NET FTP by (120 points)

The following code returns the error "No such host is known":

                            evLog.WriteEntry("get ftp folder=" + site.SiteLocation + folder.FolderName);

                            FTPConnection ftp = new FTPConnection();

                            ftp.ServerAddress = site.SiteLocation + folder.FolderName;

                            ftp.UserName = site.UserName;

                            ftp.Password = site.Password;

                            ftp.Protocol = FileTransferProtocol.FTP;

                            ftp.ConnectMode = FTPConnectMode.PASV;


I know the host works since I can connect with FileZilla, or by using the same site address, user name, and password with the FTPWebRequest net control.  What am I missing?

1 Answer

0 votes
by (46.6k points)
The ServerAddress property must be set to the IP address or the hostname, so something like "" or "my.hostname.com".  You can set the ServerDirectory property to the folder-name.