string url = ftpRootURL + ftpPath;
ftpWebRequest = (FtpWebRequest)FtpWebRequest.Create(new Uri(url));
ftpWebRequest.Credentials = new NetworkCredential(ftpUser, ftpPassword);
ftpWebRequest.Method = WebRequestMethods.Ftp.ListDirectory;
if (bEnableSsl)
{
ftpWebRequest.EnableSsl = true;
}
ftpWebRequest.KeepAlive = false;
webResponse = ftpWebRequest.GetResponse();
reader = new StreamReader(webResponse.GetResponseStream());
//这里读取==null 在访问不加密的FTP 的时候正常
string line = reader.ReadLine();
while (line != null)
{
list.Add(line);
line = reader.ReadLine();
}
ftpWebRequest = (FtpWebRequest)FtpWebRequest.Create(new Uri(url));
ftpWebRequest.Credentials = new NetworkCredential(ftpUser, ftpPassword);
ftpWebRequest.Method = WebRequestMethods.Ftp.ListDirectory;
if (bEnableSsl)
{
ftpWebRequest.EnableSsl = true;
}
ftpWebRequest.KeepAlive = false;
webResponse = ftpWebRequest.GetResponse();
reader = new StreamReader(webResponse.GetResponseStream());
//这里读取==null 在访问不加密的FTP 的时候正常
string line = reader.ReadLine();
while (line != null)
{
list.Add(line);
line = reader.ReadLine();
}
string line = reader.ReadLine();