一般我都是这样请求FTP服务器
public List<string> GetFTPFiles()
{
List<string> ftpList = new List<string>();
this.request.Method = WebRequestMethods.Ftp.ListDirectoryDetails;
try
{
using (FtpWebResponse response = this.request.GetResponse() as FtpWebResponse)
{
using (StreamReader sr = new StreamReader(response.GetResponseStream(), Encoding.UTF8))
{
string s = string.Empty;
while ((s = sr.ReadLine()) != null)
{
ftpList.Add(s);
}
}
}
}
catch (Exception)
{
ftpList.Clear();
}
return ftpList;
}
请求得