Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
303 views
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;

                            ftp.Connect();

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 (51.6k points)
The ServerAddress property must be set to the IP address or the hostname, so something like "123.123.123.123" or "my.hostname.com".  You can set the ServerDirectory property to the folder-name.

Categories

...