对于.NET的FTP客户端类客户端、NET、FTP

2023-09-04 02:59:55 作者:鬼冢

任何人都知道用在.NET中,实际上可以工作的背后HTTP代理服务器或FTP网关的好,希望免费的FTP类的?该材料的FtpWebRequest在.NET中是可怕的,在最好的,我真的不希望推出自己的位置。

Anyone know of a good, hopefully free FTP class for use in .NET that can actually work behind an HTTP proxy or FTP gateway? The FtpWebRequest stuff in .NET is horrible at best, and I really don't want to roll my own here.

推荐答案

我们的 Rebex的FTP 适用于代理就好了。继code展示了如何使用HTTP代理(code取自的 FTP教程页)。

Our Rebex FTP works with proxies just fine. Following code shows how to connect to the FTP using HTTP proxy (code is taken from FTP tutorial page).

// initialize FTP client 
Ftp client = new Ftp();

// setup proxy details  
client.Proxy.ProxyType = FtpProxyType.HttpConnect;
client.Proxy.Host = proxyHostname;
client.Proxy.Port = proxyPort;

// add proxy username and password when needed 
client.Proxy.UserName = proxyUsername;
client.Proxy.Password = proxyPassword;

// connect, login 
client.Connect(hostname, port);
client.Login(username, password);

// do some work 
// ... 

// disconnect 
client.Disconnect();

您可以下载试用的 www.rebex.net/ftp.net/download。 ASPX